Bonjour à tous,
j'ai petit soucis concernant un login sous post html, je n'arrive tout simplement pas à passer le login et obtient tout le temps la page de login comme résultat...
merci du coup de pouce :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.HttpConnection;
import java.net.URLEncoder;
import java.net.URLConnection;
import java.net.URL;
import java.io.*;
import java.io.IOException;
 
 class ConnectIntellio1 {
 
  public static void main(String[] args) {
 
	OutputStreamWriter writer = null;
	BufferedReader reader = null;
 
	try {
 
	String encodedData = URLEncoder.encode("UserID","UTF-8");
	URL url = new URL ("http://www.intellio.fr/extranet/index.php");
 
     URLConnection conn = url.openConnection();
      conn.setDoOutput(true);
	  writer = new OutputStreamWriter(conn.getOutputStream());
      writer.write(encodedData);
      writer.flush();
 
      reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
      String ligne;
      while ((ligne = reader.readLine()) != null) {
         System.out.println(ligne);
      }
 
 
      //InputStream responseBody = conn.getInputStream();
 
	  //File f=new File("outFile.html");
 
      /*BufferedOutputStream out=new BufferedOutputStream( new FileOutputStream(
                  f.getName() ) );
 
    	byte buf[]=new byte[1024];
    	int len;
    	while((len=responseBody.read(buf))>0)
    	out.write(buf,0,len);
    	out.close();
    	responseBody.close();
 
      System.out.println("Fichier créé");*/
 
 
    } catch (Exception e) {
 
      System.err.println("Fatal protocol violation: " + e.getMessage());
      e.printStackTrace();}
 
      finally {
 
      try{writer.close();}catch(Exception e){}
      try{reader.close();}catch(Exception e){}
 
    }
  }
 
 
}