在VB.NET里怎样实现输出的代码保存成文本文件?

szyyx 2006-07-31 10:32:46
比如:
public Sub Main()sub Main
dim str as String
Console.WriteLine("EXPECT 1 "login:")
str = Console.ReadLine
Console.WriteLine("EXPECT 4 "Password:")
Console.Read
end sub
在上面的语句里怎样才能把输出的 EXPECT 1 login:保存成文本文件.

...全文
327 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
szyyx 2006-07-31
  • 打赏
  • 举报
回复
谢谢!
是不是只有在控制台才能
rl0516 2006-07-31
  • 打赏
  • 举报
回复
VB.NET2005中可以用My命名空间的方法:

My.Computer.FileSystem.
貓哥是個傳說 2006-07-31
  • 打赏
  • 举报
回复


Imports System.IO


Dim objStreamWriter As StreamWriter

'Pass the file path and the file name to the StreamWriter constructor.
objStreamWriter = New StreamWriter("C:\Test.txt")

'Write a line of text.
objStreamWriter.WriteLine("Hello World")

'Write a second line of text.
objStreamWriter.WriteLine("From the StreamWriter class")

'Close the file.
objStreamWriter.Close()

16,718

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧