Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all,
i'm having an issue with reading data using ip address and it's port number, the case is
i have a weighbridge and the bridge communicate the the PC with it's ip address and the port number (192.168.1.5:12345) when i type this at web browser and it gives me the out value like (100kg) i need to write a code to do this in my c# windows form project.

Please help.
thanks,

What I have tried:

i tried with get request to the relevant port but getting exception.
Posted
Updated 25-Dec-19 20:01pm
Comments
Peter_in_2780 26-Dec-19 1:14am    
Use a tool like Wireshark to see what your browser sends to the weighbridge that your program doesn't.

1 solution

Quote:
i tried with get request to the relevant port but getting exception.

This and "It's not working" are the most useless problem descriptions we get: it tells us absolutely nothing about the problem. We don't know if you get an error message, or the wrong data, or even that that code compiles successfully!
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
So tell us what happens when you run that code, what you expected to happen, how you checked what happened. Help us to help you!

We can't help you solve this without any info on what you have tried - we don't even know how you are trying to communicate with the device, much less what code you used! And we can't test anything since we have no access at all to your device (192.168.xxx.xxx are all local IP addresses which are entirely internal to your LAN - we can't access your device that way). So all we can do is be general about the problem.

In this case if it works with a browser, then you probably need to access it via a WebBrowser control, or via the HttpWebRequest class, and pass the ip / port as the url.
If that's what you are doing, then use the debugger to find out exactly where it's failing, and look at that and the exception data to try and find out why.

In case of desperation, contact the manufacturer of the device and see if they have any sample code you can compare yours with.

We can't do any of that for you!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900