Permalink
Browse files

Add udp

  • Loading branch information...
cheetahray committed Apr 24, 2012
1 parent a1e96a4 commit 9ccbc078ee4c3165ca4b710bedc4e968d5f41527
Showing with 56 additions and 11 deletions.
  1. +53 −10 MEIBill/Form1.frm
  2. BIN MEIBill/Form1.frx
  3. +3 −1 MEIBill/Project1.vbp
View
@@ -1,15 +1,42 @@
VERSION 5.00
+Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form Form1
Caption = "Form1"
- ClientHeight = 5610
+ ClientHeight = 11790
ClientLeft = 60
ClientTop = 345
- ClientWidth = 6585
+ ClientWidth = 6690
Icon = "Form1.frx":0000
LinkTopic = "Form1"
- ScaleHeight = 5610
- ScaleWidth = 6585
- StartUpPosition = 3 'Windows Default
+ ScaleHeight = 11790
+ ScaleWidth = 6690
+ StartUpPosition = 3 '系統預設值
+ Begin VB.TextBox txtOutput
+ Height = 6135
+ Left = 3360
+ MultiLine = -1 'True
+ ScrollBars = 2 '垂直捲軸
+ TabIndex = 14
+ Text = "Form1.frx":030A
+ Top = 5640
+ Width = 3375
+ End
+ Begin VB.TextBox txtSend
+ Height = 6015
+ Left = 0
+ TabIndex = 13
+ Text = "Text5"
+ Top = 5640
+ Width = 3375
+ End
+ Begin MSWinsockLib.Winsock udpPeerA
+ Left = 6240
+ Top = 0
+ _ExtentX = 741
+ _ExtentY = 741
+ _Version = 393216
+ Protocol = 1
+ End
Begin VB.CheckBox Check4
Caption = "1000元"
BeginProperty Font
@@ -96,7 +123,7 @@ Begin VB.Form Form1
Width = 1935
End
Begin VB.TextBox Text4
- Alignment = 2 'Center
+ Alignment = 2 '置中對齊
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
@@ -114,7 +141,7 @@ Begin VB.Form Form1
Width = 855
End
Begin VB.TextBox Text3
- Alignment = 2 'Center
+ Alignment = 2 '置中對齊
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
@@ -132,7 +159,7 @@ Begin VB.Form Form1
Width = 855
End
Begin VB.TextBox Text2
- Alignment = 2 'Center
+ Alignment = 2 '置中對齊
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
@@ -150,7 +177,7 @@ Begin VB.Form Form1
Width = 855
End
Begin VB.TextBox Text1
- Alignment = 2 'Center
+ Alignment = 2 '置中對齊
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
@@ -207,7 +234,7 @@ Begin VB.Form Form1
Top = 0
End
Begin VB.ListBox List1
- Height = 5520
+ Height = 5460
Left = 0
TabIndex = 1
Top = 0
@@ -290,6 +317,12 @@ rc = mei_stop_mode(Timer1.Tag, Receive_Byte)
End Sub
Private Sub Form_Load()
+With udpPeerA
+ .RemoteHost = "192.168.11.67" '要連接到的計算機名
+ .RemotePort = 12344 '要連接到的端口號
+ .LocalPort = 12345 '該Winsock控制將要使用的本地端口號,便於其它端與該Winsock通訊
+ .Bind 12345 '將該Winsock控制綁定到該本地端口
+End With
rc = mei_close
rc = mei_open(1)
Timer1.Tag = 1
@@ -325,3 +358,13 @@ End If
List1.ListIndex = List1.ListCount - 1
If List1.ListCount > 1000 Then List1.Clear
End Sub
+
+Private Sub txtSend_Change()
+ udpPeerA.SendData txtSend.Text '發送文本
+End Sub
+
+Private Sub udpPeerA_DataArrival(ByVal bytesTotal As Long)
+ Dim strData As String
+ udpPeerA.GetData strData, vbString
+ txtOutput.Text = strData
+End Sub
View
Binary file not shown.
View
@@ -1,7 +1,8 @@
Type=Exe
Form=Form1.frm
-Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINNT\system32\stdole2.tlb#OLE Automation
+Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\WINDOWS\system32\stdole2.tlb#OLE Automation
Module=Module1; Module1.bas
+Object={248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0; MSWINSCK.OCX
IconForm="Form1"
Startup="Form1"
ExeName32="MEIBILL.exe"
@@ -14,6 +15,7 @@ MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
+VersionCompanyName="888TIGER"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0

0 comments on commit 9ccbc07

Please sign in to comment.