473,385 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Ethernet through VB

1
Does any one know how to communicate through Ethernet in VB
please tell me as soon as possible.
Jun 29 '06 #1
7 16586
sashi
1,754 Expert 1GB
Hi Anuj,

make use the bundled winsock control.. where PC A will have an IP address and PC B will have another IP Address.. in these case either one PC can play the role of a server and another one will be client..

try looking for client/server sample source codes in google.com.. perhaps the link below will give you an idea to get started.. happy trying and good luck my fren..

http://www.planet-source-code.com/vb...30413&lngWId=1
Jul 3 '06 #2
kuzure
48
Dear friends,

This is my first post in this forum. Nice to meet you guys.

I have some questions here, since VB can communicate with Ethernet, how do I "fax" a document by an ADSL?

1) I know how to fax a document by window xp. There is an available function in Window xp, all I need to do is to enable it. But, problems occur... ...

If a modem is just a device to "send" data through PSTN, does it mean the document had converted into some kind of protocol before it "give" to the modem?

Does it mean if I'm able to fax by ADSL, I need to convert the document to some kind of protocol by myself before I "give" to the ADSL?

2)If I want to fax a document, lets say, from notepad, after I click on "print", I may choose a device to print. If I choose a "fax machine"(dial up modem that detected), it will pop out a window and inquiring for the fax number, and of course, it fax.

But if I'm using an ADSL, the "device" won't show an ADSL. I cannot choose my desire "fax device".

3)an ADSL cannot dial, how do I "dial" a number by VB?

4)if an ADSL is a multiplexer, does it mean I have a chance to fax my document through PSTN?
Dec 7 '06 #3
Austen
23
Private Sub Winsock_Close()
Winsock.Close 'closes any previous connections
Winsock.LocalPort = CLng(2007) '2006 is the port number agree byboth side (Both side must use the same number)
Winsock.Listen
bPreNextFrame = True ' Resend i7
lblStatus.Caption = "Listening"
bSendActive = False
Call Twincat.Ads1.AdsSyncWriteBoolVarReq(PreMarkDataRec eive, 2&, bSendActive)
tgfrmRunTimeDate = "[" & Format(Now, "dd-mmm-yyyy") & " " & Format(Now, "hh:nn:ss") & "]"
frmRunTimeMsg.lstMsg.AddItem (tgfrmRunTimeDate & " Vision Disconnected(Pre-Mark)")
PreMarkStatus = "DISCONNECTED"
'PreMarkDataReceive = True
End Sub
Dec 11 '06 #4
Austen
23
Private sub form_Load()
'2007 is the port num used by ethernet port to identify which program is
'connecting, 1 ethernet port may have few port number( for diff program

Winsock.LocalPort = CLng(2007)
Winsock.Listen
end sub

Private Sub winsock_ConnectionRequest(ByVal requestID As Long)
Dim bErrorFlag As Boolean

'closes connection if one is already open
If Winsock.State <> sckClosed Then Winsock.Close
Winsock.Accept requestID 'allows new connection
end if
End Sub


Private Sub Winsock_Close()
Winsock.Close 'closes any previous connections
Winsock.LocalPort = CLng(2007) '2006 is the port number agree by
both side
Winsock.Listen
PreMarkStatus = "DISCONNECTED"
End Sub

command1_click ()
Winsock.SendData "INI; " & Mydate & " " & MyTime
end sub


Private Sub winsock_DataArrival(ByVal bytesTotal As Long)
Dim stData, stHeader As String

Call Winsock.GetData(stData, vbString)

'code here

end sub
Dec 11 '06 #5
kuzure
48
Private sub form_Load()
'2007 is the port num used by ethernet port to identify which program is
'connecting, 1 ethernet port may have few port number( for diff program

Winsock.LocalPort = CLng(2007)
Winsock.Listen
end sub

Private Sub winsock_ConnectionRequest(ByVal requestID As Long)
Dim bErrorFlag As Boolean

'closes connection if one is already open
If Winsock.State <> sckClosed Then Winsock.Close
Winsock.Accept requestID 'allows new connection
end if
End Sub


Private Sub Winsock_Close()
Winsock.Close 'closes any previous connections
Winsock.LocalPort = CLng(2007) '2006 is the port number agree by
both side
Winsock.Listen
PreMarkStatus = "DISCONNECTED"
End Sub

command1_click ()
Winsock.SendData "INI; " & Mydate & " " & MyTime
end sub


Private Sub winsock_DataArrival(ByVal bytesTotal As Long)
Dim stData, stHeader As String

Call Winsock.GetData(stData, vbString)

'code here

end sub


is that code for me or for Anuj???
Dec 11 '06 #6
Austen
23
is that code for me or for Anuj???

it is simple example dealing with Winsock, eternet application. is for Anuj
Dec 12 '06 #7
kuzure
48
it is simple example dealing with Winsock, eternet application. is for Anuj

sorry, i'm a newbie, but asked to do something I had never learn before, even Winsock... ...I dunno what is it!!!!!!!

hrm, I need to enable Winsock respectively? Or you mean we can just copy your code, and it will able to create a LAN network?

Still, looking for help in faxing via ADSL
Dec 13 '06 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Grant Edwards | last post by:
How does one do raw Ethernet under Win32? Ultimately, I want to do it in a Python program, but if somebody can point me to a clue on how to do it from C, I could probably figure out the rest. ...
7
by: Chaser | last post by:
Hi folks, Just wondering if anyone knows where I can find modules for NI-488.2 GPIB and for a generic ethercard? Thanks.
1
by: LkR299 | last post by:
I have a project with a PC and a microcontroller. I am trying to create a program on the PC to communicate with the microcontroller through ethernet ports. I am still deciding which language,...
1
by: dalewz | last post by:
Hi, I am thinking to use C# in MS VS.net to support GUI and Ethernet communication. I heard that this is doable by opening a socket. Could sb share more info on this? Thanks. -Dale
5
by: MLH | last post by:
Well one thing I've wanted to do is be able to PHYSICALLY connect and dis- connect a PC's xBASE-T connection via program control. The idea is... Instead of plugging your standard R-J45...
13
by: KiwiGenie | last post by:
I am trying to connect to the internet using a USB Ethernet adapter. It installs but won't connect to my dsl modem. The ethernet light on the modem doesn't even light up, though the same cable works...
11
by: gustavo.samour | last post by:
Hi, I am writing a very basic raw ethernet sniffer based on what I found in Andreas Schaufler's raw ethernet article: http://aschauf.landshut.org/fh/linux/udp_vs_raw/ch01s03.html I'm trying...
1
by: kavok | last post by:
I am writing a software that needs to sniff packets in the network (raw ethernet) and also, with another thread send regular UDP packets with the common socket API's. However, when the RAW...
3
by: jh3530 | last post by:
Hello, my apologies for the lame question, but I can't seem to figure this one out. I was recently given a laptop from my inlaws that is running windows 98. I wanted to get internet access on it,...
1
by: grndvl1 | last post by:
I am attempting to write an abstract layer to make Ethernet and Serial seemless in my application. I have an interface that is the what I call ILayer it has the method stubs for connect, disconnect,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.