c# winfrom 文件流操作的时候遇到的问题

   string path = System.Windows.Forms.Application.StartupPath;
     System.IO.Stream so = new System.IO.FileStream(path, System.IO.FileMode.Create);

这样写为什么会提示 对路径“F:\待完成\2.0版(在这个基础上修改)\源码\SRSF\SRSF\bin\Debug”的访问被拒绝。

FileStream是文件流。。你传递一个已经存在的目录是要报错的,改为你的文件,而不是目录名称

  string path = System.Windows.Forms.Application.StartupPath+@"\xxxxx.txt";

用管理员权限运行你的程序试试看

用管理员权限运行你的程序试试看