none
开发WP8程序是可以使用ON ERROR语句吗 RRS feed

  • 问题

  • 使用VS2012编写WP8程序,在一个过程里使用ON ERROR语句提示:

    错误 1 所请求的操作不可用,因为没有定义运行库函数“Microsoft.VisualBasic.CompilerServices.ProjectData.CreateProjectError”。

    怎么解决

    程序源码:

     Private Sub loadT()
            On Error GoTo aa
            Dim m() As String, i As Integer, m2() As String
            Dim a As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication
            If a.FileExists(p.Path & "\MTimerData0.txt") Then
                Dim sr As IO.StreamReader = New IO.StreamReader(p.Path & "\MTimerData0.txt")
                Dim result As String = sr.ReadToEnd()

                'result = result.Trim()
                sr.Close()
                m = result.Split(vbCrLf)

                For i = 0 To m.GetUpperBound(0)
                    If m(i).Length > 6 Then

                        m2 = m(i).Split("=")
                        If m2.GetUpperBound(0) >= 2 Then
                            times(i) = CLng(m2(0).trim)
                            scram(i) = m2(2)
                            timep(i) = m2(1)
                            timezz = timezz + 1
                        End If
                    End If
                Next
            Else
                'lblScramble.Text = p.Path & "_文件不存在"
            End If
    aa:
        End Sub

    • 已移动 Carl Cai 2014年9月19日 5:47 与wp开发相关
    2014年9月18日 8:24

答案

全部回复

  • Hello,

    鉴于该问题与windows phone 开发相关, 将这帖子移动到该论坛以获得相应技术支持。

    Carl


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年9月19日 5:48
  • 楼主 你好,

    建议使用Try Catch语句。可以参考:

    http://msdn.microsoft.com/en-us/library/ms973849.aspx

    谢谢!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年9月22日 2:45
    版主