本文整理匯總了VB.NET中Microsoft.VisualBasic.FileSystem.Write方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET FileSystem.Write方法的具體用法?VB.NET FileSystem.Write怎麽用?VB.NET FileSystem.Write使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Microsoft.VisualBasic.FileSystem
的用法示例。
在下文中一共展示了FileSystem.Write方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: SPC
' Open file for output.
FileOpen(1, "TestFile.txt", OpenMode.Output)
' Print text to the file. The quotation marks will be in the display.
Write(1, "This is a test.")
' Go to the next line.
WriteLine(1)
' Skip a line.
WriteLine(1)
' Print in two print zones. You will see commas and quotation marks
' in the output file.
WriteLine(1, "Zone 1", SPC(10), "Zone 2")
' Build a longer string before calling WriteLine.
WriteLine(1, "Hello" & " " & "World")
' Include five leading spaces.
WriteLine(1, SPC(5), "Leading spaces")
' Print a word starting at column 10.
WriteLine(1, TAB(10), "Hello")
' Assign Boolean and Date values.
Dim aBool As Boolean
Dim aDate As DateTime
aBool = False
aDate = DateTime.Parse("February 12, 1969")
' Dates and Booleans are translated using locale settings of
' your system.
WriteLine(1, aBool & " is a Boolean value.")
WriteLine(1, aDate & " is a date.")
' Close the file.
FileClose(1)
' Contents of TestFile.txt
'"This is a test.",
'
'"Zone 1", "Zone 2"
'"Hello World"
' "Leading spaces"
' ,"Hello"
'"False is a Boolean value."
'"2/12/1969 is a date."