allenfr
01-18-2011, 01:32 PM
If someone could point me in the right direction, please:
On my page load I want to open a temp.txt file, write one short string to it, and close it.
The only thing I consistantly get is this:
Could not find a part of the path 'C:\Content\App_LocalResources\temp.txt'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Content\App_LocalResources\temp.txt'.
Source Error:
Line 29: {
Line 30: // Create a file to write to.
Line 31: StreamWriter sw = File.CreateText("/Content/App_LocalResources/temp.txt");
Line 32: {
Line 33: sw.WriteLine("Opening new file");
On my page load I want to open a temp.txt file, write one short string to it, and close it.
The only thing I consistantly get is this:
Could not find a part of the path 'C:\Content\App_LocalResources\temp.txt'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Content\App_LocalResources\temp.txt'.
Source Error:
Line 29: {
Line 30: // Create a file to write to.
Line 31: StreamWriter sw = File.CreateText("/Content/App_LocalResources/temp.txt");
Line 32: {
Line 33: sw.WriteLine("Opening new file");