C# - Send And Receive A Tcp Message To A Specific IP/Port In .NET?
May 18, 2011
I'm trying to send a message to a specific IP/Port and receive a reply in an ASP.net website, i tried the method describd at the following link but it didn't work for me as you can see SocketException An attempt was made to access a socket in a way forbidden by its access permissions
View 1 Replies
ADVERTISEMENT
Aug 4, 2009
I am doing a project on sending and receiving sms from a serial port. But I have a problem on receiving sms. About the receiving sms, how can i show the received sms in the textbox using the serial port. Do I have to use the DataReceived Events. Here is the code i am using:
Public Class Form1
Private WithEvents serialPort As New SerialPort
Private ReadThread As Thread[code]....
View 1 Replies
Jan 24, 2008
I am trying to send and receive data through a USB port on my computer to an external microcontroller.
I built most of the code using the "serial class" but then i read that this would not work with a USB port.
How would I go about communicating with this USB port on my computer?
View 5 Replies
Jul 8, 2011
I have created a program to send and receive data from a serial port, some of the data needs to be stored in certain strings for a export to excel. However the data takes while to to send be sent back. So in order to get the right information in the right strings I have to put pauses in my code. I have added a timer to my form:
On my timer's tick event I have the following code:
Public Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
iTick = iTick + 1
End Sub
View 3 Replies
Apr 12, 2009
I have a USB modem that can detect caller ID and can detect dialled digits when special AT commands activated, How to send and receive data. The sent data will be the AT command such as AT+VCID-1 to activate the caller ID, the received data will be caller ID information and the digits dialed. I'm new to prgramming and using Visual Basic 2008 Express.
View 8 Replies
Oct 15, 2011
Below is my code, but when i send the message thru client socket i receive Specified argument was out of the range of valid values. Parameter name: size
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim serverStream As NetworkStream = clientSocket.GetStream()
Dim outStream As Byte() = _
System.Text.Encoding.ASCII.GetBytes("0800822000000000000004000000000000000920092126012345001")
[CODE]...
View 1 Replies
Jan 5, 2009
I am trying to recieve HEX data from a seriall device. Code is as below . but the required output is not correct. Some chracter code are not correct even in decimal . like for 80 i recieved 3F and for c0 also.for example i recived a string .
10 02 3F 00 10 03 3F 61
but in actual data should be
10 02 80 00 10 03 c0 61
[code].....
View 2 Replies
Apr 20, 2011
I use ReceiveSerialData() function to get a string (20 byte of 8 bit data) from serial portBut I faild and got the error "operation has timeout". I am new in VB 2010
View 10 Replies
Jan 5, 2009
I am trying to recieve HEX data from a seriall device. Code is as below . but the required output is not correct. Some chracter code are not correct even in decimal. like for 80 i recieved 3F and for c0 also. for example i recived a string .
10 02 3F 00 10 03 3F 61
but in actual data should be
10 02 80 00 10 03 c0 61
Public Sub DataSeriallReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort.DataReceived
Dim buff As String
[Code].....
View 2 Replies
Apr 23, 2008
I'm trying to receive data from the serial port and display onto a text box in my gui in vb. I'm using xp pro sp2 and vb 2008 exp.What i've done so far:
- I'm able to send data successfully (tested) to the serial port
- I can dispaly what data is being sent (tested)
Steps taken:
- I have looked around on this forum for something similar to what I have but no similar posts are here
- Will look into MSDN help shortly
- Will also try some vb books I have lying around. But the problem is most of the vb books deal with sql server and database stuff and not really interfacing to hardware.
View 1 Replies
Aug 12, 2010
I have blocks of data that arrives from a remote terminal via RS232/COM1 port.
Each block has carriage return at end of the data.
I like to receive the data direcly into EXCEL so it will feel like the remote computer is typing into my EXCEL.
Do I need an interface program outside EXCEL or a MACRO can do the same and how do I do it?
Is there anyway to have the serial data go to keyboard buffer that EXCEL operates from it?
View 7 Replies
Feb 28, 2011
I am working on my project "PREPAID RESTAURANT CARD USING RFID TECHNOLOGY" in which i sent 12 digit number (rfid tag id) to serial port through my hardware and receive at my vb.net 2008 page.but i don't know how to receive data in vb page in the textbox using which cammand.
View 1 Replies
Jul 22, 2009
How can receive datas from EPBX through Serial port in vb net
View 1 Replies
Mar 23, 2011
I am having problem receiving data from serial port. Btw, I am new to Visual studio 2010 too.
I do a test program on my PIC so that when button1 press, it will send character "Y" to visual studio; when button2 press, it will send character "N" to visual studio. I know for VS 2010, sending data out is by the command
[Code]...
View 1 Replies
Dec 15, 2011
I need to communicate with a PLC in serial port. PLC sends 4 possible data: 0, 1, 2 or 3 (which are status).My vb.net program uses IO.Ports.SerialPort class. When I read the data, the "1" and "2" are good, but the "0" and "3" are received as "?". I tried all the Read method (ReadByte, ReadExisting, Read, etc), it always give the same result. In HyperTerminal, it's fine.I made a test program in another computer (Win 7). Test was perfect, I received all 4 status correctly. I ran the same test program on the original computer (Win XP) and once again, I got the "1" et the "2" but the "0" and the "3" was "?" (ascii 63).
View 1 Replies
May 4, 2011
I am writing a VB based program which will receive data from a Micrcontroller (programmed in C) via UART. The data that is transmitted from the Microntroller can be displayed on Hyperterminal when I set it up with the correct settings (Baud, Parity etc), so I know that Microcontroller end is working fine. The VB-based program however (written in Visual Studio 2010 Express), does not however receive any data and I always get the TimeOut exception (despite the fact that Microcontroller is sending data via UART, I have an onboard LED to indicate this). Here is the VB code, it is an adapted version from the MSDN library:
[Code]....
View 11 Replies
Mar 7, 2012
I am working on a project to receive and send data to a micro controller using a Visual Basic application. I am using Visual Studio 2008. I have done coding to send data on button click event.
But I am stuck at how to receive incoming data to serial port continually from MCU and store it to an integer or string type data in VB.
View 1 Replies
Aug 8, 2011
I am testing out packet sending with some friends and I've made a chat program which seems good and all...(not really, its really bad actually), But anyway... The users cant receive incoming messages unless they portforward port 1337 to their computer... How can I get users to receive messages without portforwarding?
View 7 Replies
Dec 19, 2011
I want to control the D0-D7 pins of the parallel port(LPT) with VB2010. I do not need to transfer or receive data via this port, all I want is to set high or low (5V or 0V).Is it even possible?
View 4 Replies
Feb 19, 2012
My client program gets stuck on NetworkStream.Read even though the server is reporting it's sending the message. The client and server are running on the same computer.Full server code (console application)
Imports System.Net.Sockets
Imports System.Text
Module Module1
Sub Main()
[Code]...
View 1 Replies
Apr 8, 2009
I have an application that receives incoming data from a Radio Equipment through a hardware modem. How can I replace the hardware modem? Could I use the PC Sound Card in place of the modem?
View 9 Replies
Sep 17, 2009
I am wondering is there any code to get the text reply from the modem? I am using the itegno W3800 modem. I have used the below method so far but apparently VB.NET windows form doesnt see the incoming data. The message box comes out empty. But when i try the same method with the TMAS Siemens GSM modem, VB.NET can see the incoming data and display out the data string.
here is the code that i have written:
serialPort.Write("AT" & vbCrLf) 'set command message format to text mode(1)
receiveddata = serialPort.ReadExisting()
it works for the TMAS gsm modem.
The baud rate for the TMAS GSM modem is 9600 and the baud rate for the itegno modem is 115200.
For the itegno modem, the data is sort of like stuck at the serial port as after every time i pressed on the button for example "AT"
this "AT" command gets "stuck" at the serialport and run only when i have connected through the serial port in hyper terminal.
I am thinking is it the baud rate for 115200 is too fast for VB to handle? And also is there any way to solve this problem?
i have to revert back to the itegno modem for use for my project at the end of the day.
View 2 Replies
Jul 25, 2009
Since a few months I want to learn how to receive and send packets. Since WinSock doesn't work I think it'll be quite hard to get an easy way to do it.
I want to be able to send and get packets as a client. (TCP) I know that I need System.Net.Sockets, and that's quite everything...
View 5 Replies
Jan 11, 2009
I was going over the Screen Saver Tutorial for VB Express 2005 and i Noticed How the Screen Saver app excepts params at startup... and depending on the startup param it will display the screen saver or the options form... lets say that i want to start up a screen saver from my program, how would i send it to the screen saver to display the options form the param is "/p" or something.
View 2 Replies
Mar 11, 2010
I have a program that is meant to send and receive pictures. There are two parts, client and server, the server sending pictures, and client receiving.the server needs to send it across the internet, then the client needs to receive and show the image in a picture box.
View 1 Replies
Jun 18, 2009
how i send and recive sms through GSM like mobils using the AT command. vb.net have any api or control for it
View 1 Replies
Dec 19, 2010
I need to send and receive a large image between programs running on different machines within the same network.
I've looked at using upd however ran into problems with the size of the packets and
(after breaking the image into smaller pieces to get past this problem) the number of packets needing to be processed all at once - and ultimately packet loss.
I've also thought of sending the image by storing it in a common file folder and receiving it by using file watcher as a trigger. However, this just adds further complexities in setup where common folders don't already exist.
Assuming I'm barking up the right tree looking at tcp, can someone point me to/provide an example of how to send an image file using it (vb.net would be ideal). Also, are there practical limits to tcp package sizes?
View 2 Replies
Feb 29, 2012
I have these following lines to send bytes using socket
Dim server As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
Dim myIp As IPAddress = IPAddress.Parse("myIP")
Dim ip As New IPEndPoint(myIp, Int32.Parse("myPort"))
[Code]....
As in the code, I am supposed to retrieved "Halo". Instead I keep receiving sth like "[]".
View 1 Replies
Jan 24, 2011
I'm using asynchronous to send/receive from a website I want to block the BeginGetRequestStream method which I have done, using
Code:
WaitEvent.WaitOne(1000 * 20, false);
the problem is that it blocks the UI, which I thought it did not so it basically works like GetRequestStream which does block the UI.
View 3 Replies
Apr 12, 2008
Do you know how to create a program to send and receive sms and call from PC from and or to any devices?
View 1 Replies