Beer Posted October 5, 2004 Posted October 5, 2004 Hello, sorry for posting in the wrong forum, but i received a message like the one which follows: This forum does not accept new threads I do not know why... Now my problem: I want to write an application using Visual J#.net which should be able to receive some data from a php-script via port 80 and the http protocol (should be clear). The whole application already works very fine, but i don't know a class to connect to my server and receive the data... I tested it with some fantasy variables, but now it's time to get the "real" data from the web. It should work like this: xyz = new HttpConnector(); receivedData = xyz.getData(URL); /* The function MUST be able to carry (i hope it's the right word) some $_GET[] variables with it, because the PHP script has to check password(no HTTP auth), username, and which data is requested...*/ It would be fine if this function / class filters the headers automatically :rolleyes: I hope there is a class. I already looked in the MSDN library, but i did not found it :( I hope you are able to help me. Ps.: Sorry for my bad english, but i am not a native speaker :o Quote
Administrators PlausiblyDamp Posted October 5, 2004 Administrators Posted October 5, 2004 System.Net.WebClient is a good choice here, following is C# but the J# shouldn't be too different. System.Net.WebClient xyz = new System.Net.WebClient(); byte[] receivedData = xyz.DownloadData(url); out of interest which forum gave the message ' This forum does not accept new threads' ? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Beer Posted October 5, 2004 Author Posted October 5, 2004 Thank you, i will test it tomorrow, because it's already 11pm here :( Quote
Beer Posted October 5, 2004 Author Posted October 5, 2004 (edited) Yes it really works! I had to test it now ;) The only thing where you have to pay attention is that you have to use an instance of import "System.Text.ASCIIEncoding" before printing out the String, because temp.toString() will return a String like the following: [L.System;@5 Thank you very much again :) IT was the J# forum.. don't know why Edited October 6, 2004 by Beer Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.