FileStream fs = new FileStream(fileName, FileMode.Open);fileName是指向光盘的。

解决方案 »

  1.   


    Unhandled Exception: System.UnauthorizedAccessException: Access to the path 'K:\
    LICENSE.TXT' is denied.
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, I
    nt32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions o
    ptions, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
       at System.IO.FileStream..ctor(String path, FileMode mode)
      

  2.   

    你要不使用构造函数的另一个重载:
    FileStream(String, FileMode, FileAccess) 
    明确指定一下用读方式访问。