Hello dear friends. Thanks to Ranjan.D article about How To Send and Receive SMS using GSM Modem[^] I could modify his program and adapt it to my small application which needed to send a command line from a pc via sms to a digital device and this device will returns a value which is received in the PC and stored in a database. The question is, how could I do to send this command via SMS to multiple devices and get all the answers you need in one pc. I read something about "SMS Gateway" but the truth is that I'm not excited about the idea of having to make a payment for this service in addition to what I already paid to the telephone operator for the chip's and sending messages. Whould you give some ideas????
Christian_V_V
Posts
-
Sending and Recieving multiple SMS -
HttpWebRequest simultaneously!!!!HI... I managed searching in google to make a call to a server which returns me data from different GPS devices so I can save to a database. The problem is that I need to do the same but in two different server at the same time, ie, I need to get data from two different URL and save them in my database. This is what I achieved. try { byte[] buf = new byte[8192]; HttpWebRequest request = (HttpWebRequest) WebRequest.Create("http://xxx.xxx.xxx.xxx:7778/online?user=xx&pass=xxx"); HttpWebResponse response = (HttpWebResponse) request.GetResponse(); Stream resStream = response.GetResponseStream(); //int count = 0; //string tempString = ""; Thread t = new Thread(delegate() { Go(buf, resStream, listaRelojes); }); // No need to explicitly use ThreadStart t.Start(); } catch (Exception ex) { MessageBox.Show(ex.Message); } public void Go(byte[] buf, Stream resStream, LinkedList<reloj> listaRelojes) { int count = 0; string tempString = ""; tempString = Encoding.ASCII.GetString(buf, 0, count); do { count = resStream.Read(buf, 0, buf.Length); if (count != 0) { tempString = Encoding.ASCII.GetString(buf, 0, count); Parse(tempString, listaRelojes); System.Console.Out.WriteLine("my System: " + tempString); } } while (count > 0); } I need something like this I think : WebRequest.Create("http://xxx.xxx.xxx.xxx:7778/online?user=xx&pass=xxx"); and WebRequest.Create("http://yyy.yyy.yyy.yyy:7779/online?user=yy&pass=yyy"); at the same time. Is this posible??? Thank´s in advance. Christian...
-
Multithread email reader!!!Hi Dear all. I`m not a C# programmer , but I manage to make a little email Pop3 reader searching in the internet. This program has a timer and every 5 min looks into an email account and read and download some information. Now what I need is the possibility to read mails from more than one email account at the same time. IE, if I have two Gmail account, the program should look into this two account every 5 min and download the info I need. Please, anyone that help me on this. I´m using Higuchi.net lib for connecting to email accounts, it´s a very good one, anybody can google it and download it, it is free. I have tried multithreading but with no luck. My code is the following:
public partial class Pop3 : Form
{
public Pop3()
{
InitializeComponent();
}private void button1\_Click(object sender, EventArgs e) { if (this.checkBox2.Checked != true && this.checkBox3.Checked != true && this.checkBox1.Checked != true) { MessageBox.Show("Select a Conection Option"); } else { timer1.Tick += new System.EventHandler(this.OnTimerTick); timer1.Enabled = true; timer1.Start(); this.button1.Enabled = false; } } private void OnTimerTick(object sender, EventArgs e) { if (this.checkBox2.Checked == true) Gmail(); if (this.checkBox3.Checked == true) Gmail2(); if (timer1.Interval != 360000) timer1.Interval = 360000; } private void Gmail() { Pop3Client cl = new Pop3Client(); cl.UserName = "xxxxxxxxx@gmail.com"; cl.Password = "xxxxxxxxx"; cl.ServerName = "pop.gmail.com"; cl.Port = 995; cl.AuthenticateMode = Pop3AuthenticateMode.Pop; cl.Ssl = true; cl.Authenticate(); if (cl.Available == true) { if (cl.ReceiveTimeout <= 10000) { if (cl.State == Pop3ConnectionState.Authenticated) { if (Convert.ToInt32(cl.GetTotalMessageCount()) >= 1) { try { int ncount = Convert.ToIn
-
Multithread UDP listener in C#Hello to every body. My name is Christian and i´m not a c# developer (I´m a VFP developer) but some how i manage to built a little UDP server listener app in c#. I needed to do this becouse I will have several vehicles that send a data via GPRS to the server each minute and the server should be listening and decode the data to store in the database (MySql). There will be hundreds of entries per minute. I Hope that somebady can tell me if my code is multithread or not and if it´s not, how can i implement it. Also, if i need multithread in the database part. The code is this: using System; using System.IO; using System.Net.Sockets; using System.Net; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Xml; using System.Data.Odbc; using System.Data.OleDb; using System.Threading; namespace httprequest { public partial class udp : Form { private delegate void SetTextCallback(string text); private delegate void SetValCallback(int val); public udp() { InitializeComponent(); } int i; Socket soc; const int bufsize = 1024; byte[] buf = new byte[bufsize]; string szData; private void button1_Click(object sender, EventArgs e) { try { i = 0; IPEndPoint localIP = new IPEndPoint(IPAddress.Parse(this.textBox2.Text),Convert.ToInt32(this.textBox1.Text)); EndPoint epSender = (EndPoint)localIP; soc = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); soc.Bind(localIP); soc.BeginReceiveFrom(buf, 0, buf.Length, SocketFlags.None, ref epSender, new AsyncCallback(OnReceive), epSender); this.button1.Enabled = false; this.richTextBox1.Text = "Waiting for DataPacket..."; } catch (Exception ex) { MessageBox.Show(ex.Message, "SGSServerUDP", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void button2_Click(object sender, EventArgs e) { this.Close(); } private void SetText(string text) { if(i == 0) { this.richTextBox1.Clear(); i = 1; } this.rich
-
Multithreaded UDP listener in c#Hello to every body. My name is Christian and i´m not a c# developer (I´m a VFP developer) but some how i manage to built a little UDP server listener app in c#. I needed to do this becouse I will have several vehicles that send a data via GPRS to the server each minute and the server should be listening and decode the data to store in the database (MySql). There will be hundreds of entries per minute. I Hope that somebady can tell me if my code is multithread or not and if it´s not, how can i implement it. Also, if i need multithread in the database part. The source code is in this link: http://www.mediafire.com/file/kze3zztjzve/httprequest.rar[^]
-
Print a datagridview bound to a list<>Hi experts... I need to (print/preview) a datagridview bound to a list, how can i do this? Thanks in advance... Christian