當前位置: 首頁>>代碼示例>>VB.NET>>正文


VB.NET FileSystem.Write方法代碼示例

本文整理匯總了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."
開發者ID:VB.NET開發者,項目名稱:Microsoft.VisualBasic,代碼行數:40,代碼來源:FileSystem.Write


注:本文中的Microsoft.VisualBasic.FileSystem.Write方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。