الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كيف يمكن الارسال من برنامج لاخر

مغلق
بدأه serious في 2 سبتمبر 2007 · 6 رد · 684 مشاهدة · في لغة Ms Visual Basic 6 وما قبلها من إصدارات
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

لدي برنامجين الاول على جهازي والاخر على جهاز صاحبي

كيف يمكن ان اجعل احدهم يرسل للاخر بدون ماطلب اتصال

يعني مثلا (ماكون موجود على النت او مقفل البرنامج واول مافتح البرنامج تجيني الرساله من البرنامج الاخر)

بدون طلب اتصال

علما ان الاداه المستخدمه winsock

#2

أنت قصدك زي الماسنجر الجديد خدمة الرسائل الفورية هذي لازم يكون في سيرفر لك على النت ويصير في برنامج يعني الشغلة معقدة شوي.

تم تعديل هذه المشاركة بواسطة Saad AL.Moosa في 2 سبتمبر 2007 في 02:35

google.gif

spamxk4.gif

petitionbanner17a.gif

Email : sao_-5000@hotmail.com

#3

يعني الرساله تصل الى السيرفر ثم يحولها لي

#4
اقتباس
يعني الرساله تصل الى السيرفر ثم يحولها لي

اكيد يا اخي

فعند تشغيل البرنامج على الجهاز الثاني يطلب السيرفر ويتم احضار الرسائل او اي شيء اخر

#5

يعني مثل الاتصال العكسي اخي طارق

طيب ممكن شرح للطريقه

#6

Sample Code - Transmitter

1. Start Visual Basic. If Visual Basic is already running, from the File menu, choose New Project. Form1 will be created by default.

2. Place Microsoft Comm Control on Form1. If Microsoft Comm Control cannot be found in the control bar, go to Tools menu, choose Custom Controls, and then check the Microsoft Comm Control on the List Box.

3. Add the following code to the General Declarations section of Form1: ' General Declaration section

Dim Offset As Long

Dim FileData As Byte

Dim FileName As String

4. Add the following code to the Load event of Form1: ' Load event of Form

' 28800 baud, no parity, 8 data, and 1 stop bit.

' In RS-232, maximum speed of 28800 baud can be used

Private Sub Form_Load()

MSComm1.Settings = "28800,N,8,1"

MSComm1.InputLen = 1

MSComm1.CommPort = 2

MSComm1.PortOpen = True

' Change the file path to point to the file you want to transfer

FileName = "d:\sample.hlp"

Offset = 1

Open FileName For Binary Access Read As #1

End Sub

5. Add the following code to the OnComm event of MSComm1: ' ONCOMM event of Comm OLE Control

' The following code is needed to make sure that next set of

' characters can be transmitted (CommEvent = 2 is triggered from the

' receiver side)

Private Sub MSComm1_OnComm()

If MSComm1.CommEvent = 2 Then

temp = MSComm1.Input

If Offset <= FileLen(FileName) Then

Get #1, Offset, FileData

q = FileData

MSComm1.Output = Format(q, "000")

Offset = Offset + 1

End If

End If

End Sub

6. Add the following code to the UnLoad event of Form1: ' UnLoad event of Form

Private Sub Form_Unload(Cancel As Integer)

Close #1

End Sub

7. Make sure that the Properties of MSComm1 are changed as follows: RThreshold = 1 ' triggers when at least one char is on the buffer

SThreshold = 3

Back to the top

Sample Code - Receiver

1. Start Visual Basic. If Visual Basic is already running, from the File menu, choose New Project. Form1 will be created by default.

2. Place Microsoft Comm Control on Form1. If Microsoft Comm Control cannot be found in the control bar, go to Tools menu, choose Custom Controls, and then check the Microsoft Comm Control on the List Box.

3. Add a CommandButton to Form1. Command1 is created by default.

4. Add the following code to the General Declarations section of Form1: ' General Declaration section

Dim ByteCount As Long

Dim FileData As Byte

5. Add the following code to the Load event of Form1: ' Load event of Form

' 28800 baud, no parity, 8 data, and 1 stop bit.

Private Sub Form_Load()

MSComm1.Settings = "28800,N,8,1"

MSComm1.InputLen = 3

MSComm1.CommPort = 1

MSComm1.PortOpen = True

' Change the file path to point to the file you want to store

Open "c:\sample.txt" For Binary Access Write As #1

End Sub

6. Add the following code to the OnComm event of MSComm1: ' OnComm event

Private Sub MSComm1_OnComm()

If MSComm1.CommEvent = 2 And MSComm1.InBufferCount > 0 Then

FileData = CInt(MSComm1.Input)

ByteCount = ByteCount + 1

Put #1, ByteCount, FileData

MSComm1.Output = Chr$(26)

End If

End Sub

7. Add the following code to the Click event of Command1: ' CLICK event of button

Private Sub Command1_Click()

MSComm1.Output = Chr$(26)

End Sub

8. Add the following code to the UnLoad event of Form1: ' UnLoad even of Form

Private Sub Form_Unload(Cancel As Integer)

Close #1

End Sub

#7

هذا كود إيش!؟

google.gif

spamxk4.gif

petitionbanner17a.gif

Email : sao_-5000@hotmail.com

هذا الموضوع مغلق.

مواضيع مشابهة