I developed an ASP.NET web application in Visual Studio 2008.
I have an HTML document and one text file in the application, but both of them are not included in my application.
Both are outside, so when I try to run the same application on a different system, I get an error because I miss these files.
I want to include files in the application when I deploy it.
Below is the code that I use to read and write files:
FileStream file1 = new FileStream("test.txt", FileMode.Create, FileAccess.Write);
StreamWriter sw1 = new StreamWriter(file1);
sw1.Write(emailId);
sw1.Close();
file1.Close();
FileStream file = new FileStream("test.html", FileMode.Create, FileAccess.Write);
StreamWriter sw = new StreamWriter(file);
sw.Write(BodyLiteral.Text);
sw.Close();
file.Close();
file = new FileStream("test.txt", FileMode.OpenOrCreate, FileAccess.Read);
StreamReader sr = new StreamReader(file);
string cval = sr.ReadToEnd();
Response.Write(cval);
sr.Close();
file.Close();
string text = File.ReadAllText(@"D:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\test.html");
Both of my files are located in: D: \ Program Files \ Microsoft Visual Studio 9.0 \ Common7 \ IDE \
How can I deploy these two files with the application so that the program runs on a different system?