Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • Administrators
Posted

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' ?

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted (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 by Beer

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...