Click here to Skip to main content
15,914,500 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hı guys

i want to readt the txt file located in the server like http://www.yourwebsite.com/httstats.txt

StreamReader doesnt work here

what can i do ?
Posted
Updated 29-Sep-12 0:34am
v2

1 solution

Hi,

Please find the code below which enables you to read .txt file from the internet

C#
WebClient client = new WebClient();
Stream stream = client.OpenRead("http://www.catonmat.net/download/awk.cheat.sheet.txt");
StreamReader reader = new StreamReader(stream);
String content = reader.ReadToEnd();


Regards,
Ahmed Mandour
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900