示例代码:
Imports System.IO
Module Module1Sub Main()Dim fs As New FileStream("D:\Desktop\test\输出结果.txt", FileMode.Create, FileAccess.Write, FileShare.None)Dim sw As New StreamWriter(fs)Console.SetOut(sw)Console.SetError(sw)For i = 1 To 5Console.WriteLine(i)Nextsw.Flush()Console.Out.Close()Console.SetOut(Console.Out)Console.SetError(Console.Error)MsgBox("完成")End Sub
End Module
演示:
vb.net开发安卓软件的方法:https://blog.csdn.net/wgxds/article/details/135436865
免费资源下载:
带百分比的进度条控件(ProgressBar)源码:https://blog.csdn.net/wgxds/article/details/139898440
万能粘贴手(可将任意文件转为文本):https://blog.csdn.net/wgxds/article/details/140112100
vb.net帮助文档:https://blog.csdn.net/wgxds/article/details/139843942
vb.net教程:https://blog.csdn.net/wgxds/article/details/139843921
.net5.0简体中文语言包:https://blog.csdn.net/wgxds/article/details/139506634
c#和vb代码互转工具:https://blog.csdn.net/wgxds/article/details/139496929