Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
GeneralMessage Removed Pin
20-May-10 14:33
EthicsGradient20-May-10 14:33 
GeneralRe: How to clear FileSystemWatcher.Path ? Pin
Johnny J.20-May-10 19:55
professionalJohnny J.20-May-10 19:55 
GeneralMessage Removed Pin
21-May-10 3:34
EthicsGradient21-May-10 3:34 
GeneralRe: How to clear FileSystemWatcher.Path ? Pin
Johnny J.21-May-10 3:38
professionalJohnny J.21-May-10 3:38 
GeneralMessage Removed Pin
21-May-10 13:58
EthicsGradient21-May-10 13:58 
GeneralRe: How to clear FileSystemWatcher.Path ? Pin
Pete O'Hanlon23-May-10 9:11
mvePete O'Hanlon23-May-10 9:11 
QuestionWM_PAINT makes textbox non-unicode Pin
thomus0719-May-10 18:27
thomus0719-May-10 18:27 
AnswerRe: WM_PAINT makes textbox non-unicode Pin
thomus0719-May-10 18:53
thomus0719-May-10 18:53 
QuestionI Find This Baffling Pin
Roger Wright19-May-10 18:16
professionalRoger Wright19-May-10 18:16 
AnswerRe: I Find This Baffling Pin
Luc Pattyn19-May-10 18:42
sitebuilderLuc Pattyn19-May-10 18:42 
GeneralRe: I Find This Baffling Pin
Roger Wright20-May-10 3:00
professionalRoger Wright20-May-10 3:00 
GeneralRe: I Find This Baffling Pin
Luc Pattyn20-May-10 3:34
sitebuilderLuc Pattyn20-May-10 3:34 
GeneralRe: I Find This Baffling Pin
Roger Wright20-May-10 5:11
professionalRoger Wright20-May-10 5:11 
GeneralRe: I Find This Baffling Pin
Luc Pattyn20-May-10 5:20
sitebuilderLuc Pattyn20-May-10 5:20 
GeneralRe: I Find This Baffling Pin
Roger Wright20-May-10 16:10
professionalRoger Wright20-May-10 16:10 
GeneralRe: I Find This Baffling Pin
Luc Pattyn20-May-10 16:29
sitebuilderLuc Pattyn20-May-10 16:29 
GeneralRe: I Find This Baffling Pin
Roger Wright20-May-10 16:51
professionalRoger Wright20-May-10 16:51 
GeneralRe: I Find This Baffling Pin
Luc Pattyn20-May-10 17:12
sitebuilderLuc Pattyn20-May-10 17:12 
GeneralRe: I Find This Baffling Pin
Luc Pattyn20-May-10 18:08
sitebuilderLuc Pattyn20-May-10 18:08 
GeneralRe: I Find This Baffling Pin
dybs21-May-10 18:35
dybs21-May-10 18:35 
AnswerRe: I Find This Baffling Pin
dybs19-May-10 18:44
dybs19-May-10 18:44 
GeneralRe: I Find This Baffling Pin
Roger Wright20-May-10 3:02
professionalRoger Wright20-May-10 3:02 
GeneralRe: I Find This Baffling Pin
Roger Wright20-May-10 16:17
professionalRoger Wright20-May-10 16:17 
QuestionHttpWebRequest simultaneously!!!! Pin
Christian_V_V19-May-10 18:05
Christian_V_V19-May-10 18:05 
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&amp;pass=xxx"); and
WebRequest.Create("http://yyy.yyy.yyy.yyy:7779/online?user=yy&amp;pass=yyy");

at the same time.

Is this posible???

Thank´s in advance.

Christian...
AnswerRe: HttpWebRequest simultaneously!!!! Pin
Luc Pattyn19-May-10 18:45
sitebuilderLuc Pattyn19-May-10 18:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.