TiltingCode
Programmer
I am trying to learn #C 2008 using Windows 7 and have the following code:
When running in debug on the line I have colored in red execution stops and I get the following message:
Access to the path 'C:\TestFolder' is denied.
Make sure you have suffient privileges to access this resource.
If you are attempting to access a file, make sure it is not read only
I went into the folder and the file and changed all the settings to be permissions to Full control for both of them but still get that message.
Can anyone please help.
Code:
private void btnReadXML_Click(object sender, EventArgs e)
{
[COLOR=red]System.IO.StreamReader srXML = new System.IO.StreamReader(@"C:\TestFolder");[/color]
System.Xml.XmlTextReader xrXML = new System.Xml.XmlTextReader(srXML);
System.Xml.XmlDocument rXML = new System.Xml.XmlDocument();
rXML.Load(xrXML);
label1.Text = rXML.InnerText;
}
Access to the path 'C:\TestFolder' is denied.
Make sure you have suffient privileges to access this resource.
If you are attempting to access a file, make sure it is not read only
I went into the folder and the file and changed all the settings to be permissions to Full control for both of them but still get that message.
Can anyone please help.