誰可以幫我看看錯誤訊息

我用的是vs2005 vb-智慧型裝置ppc2003裝置應用程式
我要做的是從伺服器端接收廣播訊息
我的伺服器是用pc,接收裝置是用摸擬器
因為在pc上都可以接收,所以問題是在摸擬器這邊
下面是我的程式,錯誤訊息在最下面
-------------------------------------------------------------------------------------
Imports System.Net
Imports System.Net.Sockets
Imports System.Threading
Imports System.Text
Imports System.Object
Imports System.Collections.Specialized

Public Class Form1
Public uc As UdpClient
Public LocalPort As Integer
Public RemotePort As Integer
Public GroupAddress As IPAddress
Public remotEndPt As IPEndPoint
Public rT As Threading.Thread
Public bKeepRunning As Boolean = True
Public cKeepRunning As Boolean = True
Public stri_dus As String
Public str_dus As String
Public class_rb() As String
Public class_st() As String
Public ttl As Integer
Public encoding As System.Text.UnicodeEncoding = New System.Text.UnicodeEncoding


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
GroupAddress = IPAddress.Parse("224.0.1.1")
LocalPort = Int32.Parse("7777")
RemotePort = Int32.Parse("7777")
ttl = Int32.Parse("32")

uc = New UdpClient(LocalPort)
remotEndPt = New IPEndPoint(GroupAddress, RemotePort)

rT = New Thread(AddressOf Receving)
rT.Start()
Catch
MessageBox.Show("My text", "My caption", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)

End Try
End Sub
---------------------------------------------------------------------------------------------
Public Sub Receving()
Try

While bKeepRunning
Thread.Sleep(2000)
Dim data() As Byte = uc.Receive(remotEndPt)
Dim strData As String = encoding.GetString(data, 0, data.Length)
TextBox1.Text = "接收中..."

Dim get_stri As String = strData.Substring(0, 1)
Dim stri_dus As String

If RadioButton1.Checked = True Then
stri_dus = "$"
End If
If RadioButton2.Checked = True Then
stri_dus = "%"
End If
If RadioButton3.Checked = True Then
stri_dus = "@"
End If
If RadioButton4.Checked = True Then
stri_dus = "*"
End If

If get_stri = stri_dus Then
Dim get_stri2 As String = strData.Substring(1)

ListBox1.Items.Add(get_stri2)
End If

End While
Catch ex As Exception
MessageBox.Show("My text", "My caption", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)
End Try

End Sub
------------------------------------------------------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Try

uc.JoinMulticastGroup(GroupAddress, ttl)
Catch ex As Exception
Console.WriteLine(ex.ToString())
End Try

MessageBox.Show("啟動")

End Sub
-----------------------------------------------------------------------------------------
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Try
uc.DropMulticastGroup(GroupAddress)
Catch ex As Exception
Console.WriteLine(ex.ToString())
End Try
uc.Close()
rT.Abort()
TextBox1.Text = ""
MessageBox.Show("停止接收")
End Sub
End Class
------------------------------------------------------------------------------------------
按Button1的錯誤訊息:
第一個可能發生的例外狀況類型 'System.IO.FileNotFoundException' 發生於 mscorlib.dll
第一個可能發生的例外狀況類型 'System.Net.Sockets.SocketException' 發生於 System.dll
按Button2的錯誤訊息:
第一個可能發生的例外狀況類型 'System.Threading.ThreadAbortException' 發生於 System.dll
第一個可能發生的例外狀況類型 'System.Threading.ThreadAbortException' 發生於 DeviceApplication1.exe

2007-01-28 14:32 發佈
文章關鍵字 錯誤訊息
將程式load到PPC中,執行看看較準
有時模擬器無法"模擬"所有狀況的
我有傳到pda上
沒辨法收到訊息= ="
雖然有一部份CODE沒有看到, 從錯誤訊息看來好像是網路環境設定所造成. 先看程式是否真有跟Server連的上線.
拍謝~前幾天有事回家了

我之前測時用exe檔是可以接收

可是我換成模擬器時就不行了…

我到現在還搞不清楚是怎麼回事

金害= ="
先看模擬器網路環境是否跟裝置一樣, 另外在從Server 用 Ping 看能與模擬器連線.
內文搜尋
X
評分
評分
複製連結
Mobile01提醒您
您目前瀏覽的是行動版網頁
是否切換到電腦版網頁呢?