开发者

problem running system.net.webclient and process.start off a control event

The following code causes my vs 2008 wpf project to hang, I'm not sure why. Both Part 1 and Part 2 work perfectly fine independently, but when I run them together on an control event (click a button for example) the program hangs. I've also tried shell execute for part 2 - same results. However, this code when run within the form loaded event works fine. Any insights would be truly appreciated.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click

    'Part 1
    Dim myWebClient As System.Net.WebClient = New System.Net.WebClien开发者_Go百科t
    Dim CurrentDataFileContents As String = myWebClient.DownloadString("http://www.xyz.com")
    myWebClient.Dispose()

    'Part 2
    System.Diagnostics.Process.Start("http://www.test.com")

End Sub
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜