Click here to Skip to main content
15,887,856 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
by referance of article http://codesamplez.com/programming/serial-port-communication-c-sharp[^]
but i found that it can be used for windows application
Kindly suggest.
Posted
Updated 18-Mar-21 2:19am

If you are using the RS232 on the client machine for collecting data from an external device, the approach could be:
  • Collect data on the local machine.
  • Send collected data to the server (via, for instance, TCP communication[^]).
 
Share this answer
 
Comments
vivvicks 12-Oct-15 7:41am    
Thanks for u r response.But i want to fetch data from RS 232 from client machine and display in the textbox on every add button.Is it possible in web application
F-ES Sitecore 12-Oct-15 8:12am    
Your asp.net code can't interact with client hardware so there is no way of doing this without some kind of client-side component like a java applet, flash plug-in etc.
vivvicks 12-Oct-15 8:19am    
Thanks for your reply..I have one web based application running for courtier comp. They have implemented weight scale machine which is interact with client machine by RS232 port.I have 2 option either read client machine RS232 port or read value of notepad(which is generated from weight scale machine) which is located on client machine.Is it possible that i can read value of notepad from client machine in web based application.
F-ES Sitecore 12-Oct-15 8:33am    
If the client is on the same network you could read the file via a network share if you configure your site's anonymous user to be an account that has the desired access.
vivvicks 12-Oct-15 10:09am    
No they are on different network..Is there anything that can be done?
I have come across this solution..Using ActivXobject..

C#
function GetLineCount(filename) {
          alert('method start');
          var fso = new ActiveXObject("Scripting.FileSystemObject");
          var i = -1;
          if (fso.FileExists(filename)) {
              var CTF = fso.OpenTextFile(filename, 1, true);
                              data = CTF.ReadAll();
                              alert(data);
                              CTF.Close();

          }
      }

I am still doing UAT on it.
 
Share this answer
 
Comments
vivvicks 19-Nov-15 23:49pm    
At client side i have 5 machine with weight scale machine attached to it and my web application is running on it..what i m working on is as weight placed on machine on textbox blurr event i want to fetch this weight in my webform.
I am thinking of webservice that will be hosted on each client machine and on blurr event it will call webservice method which well do the com port reading part.
Kindly suggest on this appraoh

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