|
-
May 14th, 2000, 09:49 PM
#1
Thread Starter
New Member
I did.
Tahnx for reply,
yes I have an Inet1 on the form, but even then it seems to work only sometimes. This code was the only one I was able to find anywhere.
-
May 15th, 2000, 12:40 AM
#2
Lively Member
POST
Have you read this article yet? I have yet to try it myself but it looks promising to me.
http://www.vbsquare.com/internet/cgi/
Hope it helps.
-
May 15th, 2000, 12:45 AM
#3
Thread Starter
New Member
Article
Yep I did,
that will explain the GET method which is more then easy, but not the POST method.
-
May 15th, 2000, 06:11 AM
#4
Lively Member
!
-
May 21st, 2000, 12:20 PM
#5
VB not as intuitive as you'd hope
I "posted" about the same difficulty about a year ago. VB gave me intermittent results as well. I think a solution was given (in that thread), but Java has not let me down with the client/server model (and was the first to show correct results).
Depending on your needs, you might prefer to think outside of the box at
"http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html".
Scroll down to "Writing to a URLConnection" and modify as follows:
import java.io.*;
import java.net.*;
public class VBsuxAtThis {
public static void main(String[] args) throws Exception {
String strURL = "http://bohemiatrading.com/cgi-bin/protect/register.cgi";
String strFormData = "lname=LastName&fname=FirstName";
//This is comment1...You may not need the next line...see comment2
String strFormDataENCODED = URLEncoder.encode(strFormData);
URL url = new URL(strURL);
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
PrintWriter out = new PrintWriter(
connection.getOutputStream());
//This is comment2...You can probably get by using
// out.println(strFormData);
//instead of the next line
out.println(strFormDataENCODED);
out.close();
BufferedReader in = new BufferedReader(
new InputStreamReader(
connection.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|