Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Web
i have a program that connect through serial to GSM Modem i need to get data by SMS
 
and then send these data to my website SQL database
 
how can i do these configurations i can get data serially but i don't know how to connect with website ?
Posted 26-Apr-11 12:52pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

A web service would be the simplest approach. Google for "C# web service" and you'll get lots of hits.
  Permalink  
Comments
SAKryukov at 26-Apr-11 18:14pm
   
More or less agree (my 5), but the question is about a Web site. Maybe it is required (if not Web site, why not something even more flexible like a custom service with fully-fledged inversion of control, publisher-subscriber and so on, right?).
 
Assuming OP just got to deal with a Web site, please see my answer.
--SA
Nishant Sivakumar at 26-Apr-11 18:20pm
   
Thank you, SA!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

If you're bound to use the Web site (and not the Web Service as Nishant correctly proposed), you can use the class System.Net.HttpWebRequest to request the Web server and get response using System.Net.HttpWebResponse.
 
Here is one trick to know: you really need to use System.Net.HttpWebRequest via a compile-time type System.Net.WebRequest. Run-time type is defined by the URL. For example, see how to do POST:
http://msdn.microsoft.com/en-us/library/debx8sh9.aspx[^].
 
—SA
  Permalink  
Comments
Nishant Sivakumar at 26-Apr-11 18:21pm
   
Good answer, SA. Voted 5.
SAKryukov at 26-Apr-11 18:23pm
   
Thank you, Nishant.
--SA

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

  Print Answers RSS
0 OriginalGriff 190
1 Jochen Arndt 165
2 PIEBALDconsult 150
3 BillWoodruff 148
4 DamithSL 140
0 OriginalGriff 5,695
1 DamithSL 4,591
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 26 Apr 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100