Home > Net >  Help: using the File. The Exists judgment File folder directory but not the File Exists
Help: using the File. The Exists judgment File folder directory but not the File Exists

Time:11-27

The string filename=@ "C: \ Windows \ System32 \ Hi bin".
if (! File. The Exists (filename))
{
FileStream fs.
Fs=new FileStream (filename, FileMode. Create);
Fs. The Close ();
}
The else
{
FileStream fs.
//create a file stream
Fs=new FileStream (filename, FileMode. Open);
Fs. The Close ();
}

CodePudding user response:

Files are hidden, modify the resource manager configuration, display all files and have a look

CodePudding user response:

Look at the following Settings folder options show hidden files display system

CodePudding user response:

Open a console
Enter
C: enter
CD C: \ Windows \ System32 enter
Dir *. Bin/a
Have a look

CodePudding user response:

Have configured show hidden files display system, according to the webmaster tips through the console to find the file, prompt "can't find the file", if the other set can be normal to create the file, can also show that is the reason why the System32 folder?

CodePudding user response:

The
reference 3 floor caozhy response:
open the console
Enter
C: enter
CD C: \ Windows \ System32 enter
Dir *. Bin/a
Did see

Tip: can't find the file

CodePudding user response:

reference 4 floor shu_kether response:
have configured show hidden files display system, according to the webmaster tips through the console to find the file, prompt "can't find the file", if the other set can be normal to create the file, can also show that is the reason why the System32 folder?

Yes, in the system tray and related directory operations need to be right to mention
In order to avoid trouble, unless the design requirements
User management files on other dish best

CodePudding user response:

The string filename=@ "C: \ Windows \ System32 \ Hi bin".
if (! File. The Exists (filename))

The second sentence to remove exclamation mark if is ok
  •  Tags:  
  • C#
  • Related