onepieceking
Well-known member
- Joined
- Sep 20, 2006
- Messages
- 64
- Programming Experience
- 1-3
Hi,
I know that Server.MapPath will path the virtual path to physical path of the server. It means for the above code, it will be in "C:\Inetpub\wwwroot\Project1\".
I need the file to be in another directory called "All" in the server. Do i just write objStreamWriter = File.AppendText(C:\All\Output.txt)? Will this save the file in the client or the server?
VB.NET:
'Open a file for writing
Dim FILENAME as String = Server.MapPath("Output.txt")
'Get a StreamReader class that can be used to read the file
Dim objStreamWriter as StreamWriter
objStreamWriter = File.AppendText(FILENAME)
'Append the the end of the string, "A user viewed this demo at: "
'followed by the current date and time
objStreamWriter.WriteLine("A user viewed this demo at: " & DateTime.Now.ToString())
'Close the stream
objStreamWriter.Close()
I know that Server.MapPath will path the virtual path to physical path of the server. It means for the above code, it will be in "C:\Inetpub\wwwroot\Project1\".
I need the file to be in another directory called "All" in the server. Do i just write objStreamWriter = File.AppendText(C:\All\Output.txt)? Will this save the file in the client or the server?