tags:

views:

72

answers:

3

please advise on the following, and if you were to do something different please let me know.

with a c# app i am auditing conversations between cellphones. here's what happens:

  1. someone sends a text to my phone which is attached to my computer
  2. my c# catches the message and it forwards it to another phone number
  3. the person receiving the message will reply to it
  4. the reply goes back to my computer
  5. my application forwards the text back to the originator

i want to capture these conversations on my website in real-time

  1. the simplest solution would be to update some html file and automatically upload it to my ftp server. although it's the simplest solution, i dont think it will look so great. would there be a different, simple way to do his but have it look pretty good?

  2. what should i use to update and upload the application? should i just have my winforms c# app update some file? what would i use to upload that file?

+1  A: 

You should be using a database instead of HTML files.

Rob
+1  A: 

Update a database instead and then from the web page use an AJAX request to a backend script to pull updates from the database.

For example, your c# application stores the texts as records in a mysql database on your remote machine then the website contains some javascript which polls the server, eg start a timer with a callback to do an AJAX request back to the server to some script which responds with the last X records, or even a delta of the records since the last request, and update an area of the page with the information.

Note there is also Server Push, eg Comet where rather than constantly asking the server for changes from the client side as previously described you hold open a connection to the server from the users browser and push the changes to the browser whenever the server wants to.

Steve
+1  A: 

So it sounds like you are wanting a windows application to update the content of a website on a separate machine when the SMS data is intercepted by your app.

Going on this assumption, I'm going to suggest you implement a web service of some sort on the website that will accept a new message from your app. This, of course, also assumes you have the ability to create web services on your web site, which may or may not be correct. If you can then you should potentially look into creating a RESTful service on your site that will allow you to POST the new message to a specific URL (http://www.mysite.com/SMS/NewMessage for example). You can then use the System.Net.WebClient class to construct the POST request to this URL. When doing this you'll want to make sure you include some authentication on your service so that not just anyone can add new messages (which can be done using IIS and/or settings in the web.config). You could also use a standard SOAP web service if that would be easier for you to implement. As long as you can restrict access to the service URL you should be good.

ckramer