-1

I have used this before in Windows XP and VS2008 and never got this error now using VS 2012 and windows 8.

This is my simple code to create a file in c drive is giving exception

string path = @"C\SaveValues.txt";
if (!File.Exists(path))
{
    using (File.Create(path))
    {
    }
}

Could not find a part of the path 'C:\Program Files (x86)\IIS Express\C\SaveValues.txt'.

What is this error referring to?

4

1 回答 1

4

Change it to

string path=@"C:\SaveValues.txt"; (mainly look at C: )

于 2013-03-30T01:00:17.647 回答