当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > Code: Writing Text to a File (Visual Basic)

ASP.NET
[EnterpriseServices]利用assembly定义我们的组件在COM+中的注册方式
crystal reports for Visual Studio .NET(webformsample)
XML指南:微软的XML解析器
展现C# 清单5.10 生成exe文件执行的问题
vb.net 读写xml方法(1)
选择文件夹的对话框控件c#
特洛伊木马服务器源代码(C#)
上传图片画带阴影的水印.(C#)
vb.net读写xml(2)--实现datagrid与xml的沟通(原创)
列出所有的sheet,然后点击其中的一个,自动跳过去
从VB中的Datagride中向excel导入数据
XML指南:XML CDATA
XML指南:XML编码
XMLDOM对象方法:Document对象方法
XMLDOM对象方法:对象事件
XMLDOM对象方法:对象属性
[一个登录窗体的完整范例,包括登录,密码更改,输入错误三次退出]
[关于判断输入数据是否在数据库中的方法。]
[VBA]office中内建的faceid所对应的图标
web组件设计,利用接口(IPostBackDataHandler)产生数据回传的问题

ASP.NET 中的 Code: Writing Text to a File (Visual Basic)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 74 ::
收藏到网摘: n/a


This example writes a string to a text file using the WriteLine method of the StreamWriter class.ExampleDim file As New System.IO.StreamWriter("c:\test.txt")file.WriteLine("Here is the first line.")file.Close()Compiling the Code
This example requires: A reference to System namespace. Robust Programming
The following conditions may cause an exception: The file exists and is read-only (IOException Class). The disk is full (IOException Class). The pathname is too long (PathTooLongException Class). Security
This example creates a new file, if the file does not already exist. If an application needs to create a file, that application needs Create access for the folder (see Access Control). If the file already exists, the application needs only Write access, a lesser privilege. Where possible, it is more secure to create the file during deployment, and only grant Read access to a single file, rather than Create access for a folder.