Code: Writing Text to a File (Visual Basic)

梦里捡石头

梦里捡石头

2016-01-29 12:39

Code: Writing Text to a File (Visual Basic),Code: Writing Text to a File (Visual Basic)

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.
展开更多 50%)
分享

猜你喜欢

Code: Writing Text to a File (Visual Basic)

电脑网络
Code: Writing Text to a File (Visual Basic)

Visual Basic 编码

编程语言 网络编程
Visual Basic 编码

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

Visual Basic 概述

编程语言 网络编程
Visual Basic 概述

Visual Basic 概念

编程语言 网络编程
Visual Basic 概念

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

安装 Visual Basic

编程语言 网络编程
安装 Visual Basic

Visual Basic CommandButton 控件

编程语言 网络编程
Visual Basic CommandButton 控件

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

AddNew Method Example

AddNew Method Example

巧用CSS控制鼠标样式变换

巧用CSS控制鼠标样式变换
下拉加载更多内容 ↓