其他需要完善的地方:
查看Log文件
Private Sub btnLog_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles btnLog.Click Dim logfile As String = Application.StartupPath.TrimEnd("\") & "\err.txt" If File.Exists(logfile) = False Then tsslInfo.Text = "日志文件不存在" Exit Sub End If Process.Start(logfile) End Sub
显示关于窗口:
Private Sub btnAbout_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles btnAbout.Click FormAbout.ShowDialog() End Sub
退出程序:
Private Sub btnExit_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles btnExit.Click Application.Exit() End Sub
关于窗体中的代码:
Private Sub FormAbout_Load(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles MyBase.Load lblProgram.Text = Application.ProductName lblAuthor.Text = "http://blog.csdn.net/uruseibest" End Sub Private Sub btnOk_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles btnOk.Click Me.Close() End Sub
至此,一个完整的程序就完成了。
运行时如下图:
由于.net平台下C#和vb.NET很相似,本文也可以为C#爱好者提供参考。
学习更多vb.net知识,请参看vb.net 教程 目录