PDA

View Full Version : ایا کنترل winsockتویvb2005 هست؟



romisa_18
چهارشنبه 17 بهمن 1386, 10:33 صبح
با سلام
من می خواستم یک بر نامه چت توی vb2005 بنویسم می خواستم ببینم آیا تویvb2005 کنترلwinsock که درvb6 وجود داره هست یا باید از کلاسهای سوکت استفاده بشه.

yavari
چهارشنبه 17 بهمن 1386, 20:42 عصر
سلام

اینو ببین :
http://www.codeproject.com/KB/cpp/winsockdotnet.aspx

میتونی از کلاسهای سوکت ، نت و یا ریموتینگ استفاده کنی .

موفق باشید

romisa_18
شنبه 20 بهمن 1386, 19:39 عصر
از کمکتون بی نهایت متشکرم.

Pouria.NET
یک شنبه 21 بهمن 1386, 15:04 عصر
در کتاب P2P with VB.NET نوشته Matthew MacDonald هم یک Chatting Application رو بصورت کامل توسعه داده (با استفاده از .NET Remoting). اگر کتاب رو خواستید من میتونم بهتون بدم

saeghe3000
دوشنبه 22 بهمن 1386, 00:17 صبح
دوست عزیز Pouria.NET
من کتاب رو میخوام
اگه مبشه لطف کن بده
دو نقطه دی

saman_itc
دوشنبه 22 بهمن 1386, 13:47 عصر
سادق جان گرفتی شماره شابک به من میدی؟

amirsajjadi
سه شنبه 23 بهمن 1386, 08:18 صبح
با سلام
این لینک رو ببین
http://barnamenevis.org/forum/showpost.php?p=423051&postcount=1
اگه مثالی خواستید بگید تا sample بفرستم

saman_itc
سه شنبه 23 بهمن 1386, 08:39 صبح
این اسم کتابشه
Windows Sockets Network Programming (http://tangentsoft.net/wskfaq/reviews/wsnp.html)

by Bob Quinn and Dave Shute
Addison-Wesley Publishing Company, November 1995
637 pp., with source code on 3.5" disk
ISBN 0-201-63372-8
$54.99 list, $50.04 at Amazon.com (click to purchase) (http://www.amazon.com/exec/obidos/ASIN/0201633728/winsockprogramme)

Book reviewed 9/7/1998

http://www.codeproject.com/KB/dotnet/DetectSocketConectionLoss.aspx










The Examples


Basic Example Programs (http://tangentsoft.net/wskfaq/examples/basics/index.html)
Ping: ICMP.DLL Method (http://tangentsoft.net/wskfaq/examples/dllping.html)
Ping: Raw Sockets Method (http://tangentsoft.net/wskfaq/examples/rawping.html)
Passing Sockets Between Processes (http://tangentsoft.net/wskfaq/examples/fdpass.html)
Get the Local IP Address(es) (http://tangentsoft.net/wskfaq/examples/ipaddr.html)
Get Interface Information (http://tangentsoft.net/wskfaq/examples/getifaces.html)
Get MAC Address, NetBIOS Method (http://tangentsoft.net/wskfaq/examples/getmac-netbios.html)
Get MAC Address, RPC Method (http://tangentsoft.net/wskfaq/examples/getmac-rpc.html)
Get MAC Address, SNMP Method (http://tangentsoft.net/wskfaq/examples/getmac-snmp.html)
Get the Username (http://tangentsoft.net/wskfaq/examples/username.html)
How to Packetize a TCP Stream (http://tangentsoft.net/wskfaq/examples/packetize.html)
How to Check for a RAS Connection (http://tangentsoft.net/wskfaq/examples/rascheck.html)





Try

Dim ReceivedBytes As Integer

Dim tmpBuffer As Byte()

ReDim tmpBuffer(1024)



While blActive And Socket.Connected

' Resetting received bytes

tmpBuffer.Clear(tmpBuffer, 0, tmpBuffer.Length)

' Getting new bytes

ReceivedBytes = Socket.Receive(tmpBuffer, 0, tmpBuffer.Length, Sockets.SocketFlags.None)

' Note: monitoring the blActive member as socket might have been closed prior the this point

If ReceivedBytes > 0 And blActive Then

' Your code here to handle the new data

DataReceived_Handler(tmpBuffer) ' <- Your handler

Else

' if returned with 0 bytes, that means the connection is lost
' Use your personalized code to handle the closure of the connection
yourCloseSocket() ' close the connection

End If



End While