使用vb.net代码在C:\中创建文件时出错 [英] Error creating file in C:\, using vb.net code

查看:102
本文介绍了使用vb.net代码在C:\中创建文件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试使用代码在C中创建一个文本文件。它说访问被拒绝。

请帮助。



Hi,
I am trying to create a text file in C: using code. It says access is denied.
Please help.

Dim vrCommand As String = "This is my test file data"

        System.IO.File.AppendAllText(vrFilePath, vrCommand & vbCrLf)







返回错误:




It return error:

Access to the path 'C:\' is denied.

推荐答案

是的,您需要管理员权限才能写入OS驱动器根目录(自Windows Vista起)



祝您好运!
Yes, you need administrator privileges to write to the OS drive root (since windows vista)

Good luck!


http://www.vbforums.com/showthread.php?561581-RESOLVED-Access-to-the-path-C-Check-txt-is-denied [ ^ ]





http://www.daniweb.com/software-development/vbnet/threads/393227/access-to-the-path-cblablabla-is -denied [ ^ ]


这篇关于使用vb.net代码在C:\中创建文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆