在网络共享文件夹中写入文件时出现 UnauthorizedAccessException?
您好,win mobile 6 代码尝试在网络共享文件夹上写入文件,但总是收到 UnauthorizedAccessException。我已检查该文件夹的权限和安全设置,代码可以读取该文件,但无法写入该文件。该代码在管理员帐户下运行,该帐户可以完全控制文件夹和文件。它是在 vs 2008 professional 中,带有设备模拟器。请问有什么帮助吗?非常感谢。
hi the win mobile 6 code tries to write files on network shared folder, but always gets UnauthorizedAccessException. I have checked permission and security setting on the folder and the code can read the file but just cant write to it. The code runs under administrator account which has full control over the folder and files. It is in vs 2008 professional with device emulator.Any help please? thanks very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您已经验证可以在程序之外写入该文件,对吗?即登录到计算机帐户并尝试将该特定文件放在那里。
您有权访问托管该文件的系统吗?如果是这样,您可以检查其访问日志以验证您的应用程序正在使用哪个帐户。
我的猜测是,您的应用程序没有使用您认为的帐户,或者管理员帐户实际上可能没有对该文件夹或文件的写入权限。
You've verified that you can write the file outside of your program, correct? i.e. logged into a machine account and tried placing that specific file there.
Do you have access to the system that hosts the file? If so, you can check it's access logs to verify which account your app is using.
My guess would be that either your app isn't using the account you think it is, or that the admin account may doesn't actually have write access to that folder or file.