Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Suthish NairRank #92 · 22.8K reputationPosted Oct 24, 2010, 10:22 PM EDT
check the notepad way:
http://www.c-sharpcorner.com/UploadFile/dhavalweb30/2340/
Koteswararao MallisettiRank #2,740 · 511 reputationPosted Oct 24, 2010, 10:25 PM EDT
next this is the code to write the data into text file
FileInfo fileinfo;
string filepath = @"E:\emailLogfile.txt";
fileinfo = new FileInfo(filepath);
if (!fileinfo.Exists)
{
fileinfo.Create();
}
StreamWriter eventlogwriter = fileinfo.AppendText();
string completemsg = msg; //this message is displayed on the txt file in the specified path
eventlogwriter.WriteLine(completemsg);
eventlogwriter.Close();
manoj kumar124 reputationPosted Oct 24, 2010, 10:36 PM EDT
Suthish NairRank #92 · 22.8K reputationPosted Oct 24, 2010, 10:49 PM EDT
search for HttpWebRequest class
manoj kumar124 reputationPosted Oct 24, 2010, 10:53 PM EDT
bt its not give me any output..
string baseUrl = "http://www.4guysfromrolla.com/articles/051802-1.aspx";
WebRequest requestHTML = WebRequest.Create(baseUrl);
WebResponse responseHTML = requestHTML.GetResponse();
StreamReader reader = new StreamReader(responseHTML.GetResponseStream());
String htmlContent = reader.ReadToEnd();
manoj kumar124 reputationPosted Oct 24, 2010, 11:46 PM EDT
give me error.
Suthish NairRank #92 · 22.8K reputationPosted Oct 24, 2010, 11:52 PM EDT
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"www.yahoo.com"); //request.Credentials = new NetworkCredential(UserName, Password); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream receiveStream = response.GetResponseStream(); StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8); StreamWriter sw =new StreamWriter("G://test.txt"); String line; while ((line=readStream.ReadLine())!=null) { sw.WriteLine(line); } sw.Close();manoj kumar124 reputationPosted Oct 25, 2010, 12:32 AM EDT
Bt I have another problum.
First time create folder..if we are create another time it's give me error..
I want to all time create unique folder according time..
Suthish NairRank #92 · 22.8K reputationPosted Oct 25, 2010, 2:09 AM EDT