R
rex64
I am getting an error message and I have not been able to figure hot
how to fix it. I have done some research with no answers yet.
I found this code that may help? Not sure what to do with it.
using (StreamWriter sw = new StreamWriter (fullAddress , false,
Encoding.UTF7))
Error message::::::::::::::::::::::::::::::::::::::::::::::
how to fix it. I have done some research with no answers yet.
I found this code that may help? Not sure what to do with it.
using (StreamWriter sw = new StreamWriter (fullAddress , false,
Encoding.UTF7))
Error message::::::::::::::::::::::::::::::::::::::::::::::
Code:
Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name
'StreamWriter' could not be found (are you missing a using directive or
an assembly reference?)
Source Error:
Line 40:
Line 41:
Line 42: StreamWriter sw = new StreamWriter(arg1, arg2); //This was
commented out????
Line 43: //the line above is where I get the errors either way.
Line 44:
Source File: E:\webapps\finance\gfst\asp\jeffUploadNsave.aspx Line:
42
Code::::::::::::::::::::::::::::::
void WriteToFile(string szData, string szFilePath)
{
//Write to file
StreamWriter sw = new StreamWriter(arg1, arg2); //This was commented
out???? StreamWriter(arg1, arg2);
//the line above is where I get the errors either way.
// Constructor with 2 arguments:
// 1) Path location of file
// 2) Append or Overwrite Data
StreamWriter(@"G:\Inetpub\wwwroot\csf\Tutorials\Exec\fileIO.txt",true);
//This will append the given input to the file since arg2 is true
sw.Write("I love C# and I don't care who knows it!~~" + "<br>");
//Cleanup
sw.Close();
}