public string LocalFile()
{
string TextFilePath = @"D:\WriteTest.txt";
using (StreamWriter writer = new StreamWriter(TextFilePath,true))
{
writer.WriteLine("Hello");
writer.WriteLine("---------------------------");
writer.WriteLine("Web Developer In the Universal");
writer.WriteLine("---------------------------");
writer.WriteLine("Great DaY");
writer.WriteLine("---------------------------");
}
return "File Created";
}
public string ServerFile()
{
string TextFilePath = @"~/WebData/WriteTest2.txt";
using (StreamWriter writer = new StreamWriter(Server.MapPath(TextFilePath),true))
{
writer.WriteLine("Hello");
writer.WriteLine("---------------------------");
writer.WriteLine("Web Developer In the Universal");
writer.WriteLine("---------------------------");
writer.WriteLine("Great DaY");
writer.WriteLine("---------------------------");
writer.WriteLine("Great OtherDaY");
writer.WriteLine("---------------------------");
}
return "Generated";
}
{
string TextFilePath = @"D:\WriteTest.txt";
using (StreamWriter writer = new StreamWriter(TextFilePath,true))
{
writer.WriteLine("Hello");
writer.WriteLine("---------------------------");
writer.WriteLine("Web Developer In the Universal");
writer.WriteLine("---------------------------");
writer.WriteLine("Great DaY");
writer.WriteLine("---------------------------");
}
return "File Created";
}
public string ServerFile()
{
string TextFilePath = @"~/WebData/WriteTest2.txt";
using (StreamWriter writer = new StreamWriter(Server.MapPath(TextFilePath),true))
{
writer.WriteLine("Hello");
writer.WriteLine("---------------------------");
writer.WriteLine("Web Developer In the Universal");
writer.WriteLine("---------------------------");
writer.WriteLine("Great DaY");
writer.WriteLine("---------------------------");
writer.WriteLine("Great OtherDaY");
writer.WriteLine("---------------------------");
}
return "Generated";
}
0 Comments
if you have any doubts , please let me know