调用子例程时的代码路径问题

时间:2015-02-15 16:50:54

标签: vb.net

这个例子有什么问题?我无法继续使用原始代码路径。它成功执行 Options.LoadAccount(),然后停止。我已尝试创建选项的新实例,但它只是产生了错误,并建议我将其切换回下面的示例。

这是启动表格。

Public Class Loading

    Private Sub Loading_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'Load Account
        Loading("Loading Account")
        Options.LoadAccount()

        'Load Points
        Loading("Loading Point Settings")
        Options.LoadPoints()

        Main.Show()
        Me.Close()
    End Sub

    Private Sub Loading(msg As String)
        lblStatus.Text = msg
        lblStatus.Refresh()
        loadBar.PerformStep()
        loadBar.Refresh()
    End Sub
End Class

此类或表单尚未加载,但断点证明 Sub LoadAccount()已执行,但断点也证明代码路径未返回 Public Class正在加载并执行 Options.LoadPoints()。为什么呢?

Public Class Options
    Public Shared Sub LoadAccount()
        Options.User = GetSetting("UTB", "Account", "User")
        Options.OAuth = GetSetting("UTB", "Account", "OAuth")
        Options.Channel = GetSetting("UTB", "Account", "Channel")
        Options.AuthCode = GetSetting("UTB", "Account", "AuthCode")
        Options.ChannelTitle = GetSetting("UTB", "Account", "ChannelTitle")
        Options.Game = GetSetting("UTB", "Account", "Game")
        Options.Delay = GetSetting("UTB", "Account", "Delay")
    End Sub
End Class

0 个答案:

没有答案