Hey guys, I am working on a small program in C# and need to figure out how to do this. I tried googling it, but nothing but local text file help comes up.

So what im wanting to know is, how to write text to an online textfile such as http://a1own.com/mytextfile.txt.
How would i do this?

6 Years
Discussion Span
Last Post by GAME

Hey guys, I have been doing some research and have found this out. It is best to first set the post data of a php file and then have that php file write to the text file.

So, here is my php file:

$myFile = "http://a1own.com/mytextfile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "COMMAND GOES HERE";
fwrite($fh, $stringData);

Now, I am wanting to use C# to set the $stringData to whatever I am writing. How would I do that. I was looking here: http://msdn.microsoft.com/en-us/library/debx8sh9.aspx but couldn't seem to figure out how to use the httpwebrequests. Can anyone please help me piece this together???


If I were you I would try to make a thread in the PHP forums. And in the post say, I would like to be able to update the text by entering the text I want to enter in my URL. I did something like to a database. I lost the files. :(

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.