Jquery中文网 www.jquerycn.cn
Jquery中文网 >  脚本编程  >  Vb.net  >  正文 Code: Writing Text to a File (Visual Basic)

Code: Writing Text to a File (Visual Basic)

发布时间:2018-09-14   编辑:www.jquerycn.cn
jquery中文网为您提供Code: Writing Text to a File (Visual Basic)等资源,欢迎您收藏本站,我们将为您提供最新的Code: Writing Text to a File (Visual Basic)资源
<script>ec(2);</script>
This example writes a string to a text file using the WriteLine method of the StreamWriter class.
Example
Dim file As New System.IO.StreamWriter("c: est.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.

您可能感兴趣的文章:
HOW TO: Set a Windows Hook in Visual C# .NET-Windo
jQuery模板技术和数据绑定实现代码
jQuery template advanced merge
String to XML Document
JS文件读写代码 js读取与写入文件
jQuery 开发者应该注意的9个错误
jQuery相册展示插件 EOGallery
VBScript 简介
jQuery语法高亮插件支持各种程序源代码语法着色加亮
juqery 学习之三 选择器 子元素与表单

[关闭]