0

I have created a simple app which will do some calcualtions when user input some values.The app is working properly but when user forget to input some values in a textbox and run the app; the app stops working and it hangs. I want to know is there any simple error handling script for windows phone sdk.

I have used this error handiling script before in visual basic and in their its work perfectely.

On Error GoTo error_handler

    Dim one,two ....

 //some codes
.
.
......

error_handler:

        Textblock1.Text = "Error"

I tried to use this above script in sdk but its showing this error

Requested operation is not available because the runtime library function 'Microsoft.VisualBasic.CompilerServices.ProjectData.CreateProjectError' is not defined.   
4

1 回答 1

0

正如我在问题中所问的那样,我正在寻找一个简单的错误处理脚本。我使用 try 和 catch 方法“意外地”找到了错误处理脚本。下面是我用于错误处理的代码。

Try

// Your code for app

Catch ex As Exception

MessageBox.Show(ex.Message.ToString(), "Error!", MessageBoxButton.OK)

End Try
于 2013-11-05T05:07:45.710 回答