Click here to Skip to main content
Rate this: bad
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
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.
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.
Nishant Sivakumar at 26-Apr-11 18:20pm
Thank you, SA!
Rate this: bad
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:[^].
Nishant Sivakumar at 26-Apr-11 18:21pm
Good answer, SA. Voted 5.
SAKryukov at 26-Apr-11 18:23pm
Thank you, Nishant.

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

  Print Answers RSS
0 OriginalGriff 645
1 Maciej Los 225
2 Abhinav S 171
3 Richard Deeming 160
4 Suvendu Shekhar Giri 159
0 Sergey Alexandrovich Kryukov 9,623
1 OriginalGriff 9,135
2 Peter Leow 5,042
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 2,581

Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 26 Apr 2011
Copyright © CodeProject, 1999-2015
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