在Win 7中从.net 2008编写文本文件 [英] Write a text file from .net 2008 in win 7

查看:96
本文介绍了在Win 7中从.net 2008编写文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Windows 7中从.net 2008中写入文本文件?

How can I write a text file from .net 2008 in windows 7 ?

推荐答案

对于Windows应用程序,您需要使用以管理员身份运行"来运行.exe文件或授予要在其上执行写文件操作的文件夹的R/W权限.
对于Web应用程序,您需要向IUser提供R/W权限,并在可能的情况下向所有人提供R/W权限.
For Windows application you need to run the .exe file with Run As Administrator or Give R/W rights to folder on which you are trying to do the write file operation.
For Web Application you need to provide R/W permission to IUser and if possible give R/W rights to everyone.


尝试:
Dim lines As String() = New String() {"Line one", "line two", "I'm bored now"}
File.WriteAllLines(path, lines)


这篇关于在Win 7中从.net 2008编写文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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