Using Post in Navigate method of Web Browser problem - OLE Automation [message #437205] |
Tue, 01 June 2004 06:55 |
Eclipse User |
|
|
|
Originally posted by: shardul_mhaskar.persistent.co.in
Hello there,
I am trying to embedd an IE browser in an Eclipse perspective using SWT/OLE.
I want to make the embedded IE browser to perform an auto login to a web
site. Currently I am using the browser.Navigate() method to do so and
passing on all the relevant login information in the URL itself. Although
this works fine, i dont want to send the login information as a part of the
URL. A POST req is what i want to use to send the login information.
I tried the the standard way of posting data as described in some of the
examples. The below code snip execmplifies a typical call.
<theCodeSnip>
int[] rgdispid = webBrowser.getIDsOfNames(new String[]{"Navigate",
"URL","Flags","TargetFrameName","PostData" ,"Headers"});
int dispIdMember = rgdispid[0];
Variant[] rgvarg = new Variant[2];
int[] rgdispidNamedArgs = new int[2];
rgvarg[0] = new Variant("http://testSite/"); // the HOST
rgdispidNamedArgs[0] = rgdispid[1];
rgvarg[1] = new
Variant("login=admin&loginstate=0&encryptpasswd=passwd "); // Data to be
posted
rgdispidNamedArgs[1] = rgdispid[4];
webBrowser.invoke(dispIdMember, rgvarg, rgdispidNamedArgs);
</theCodeSnip>
But this does not seem to work. Is there a work around for this or is it
that i am not constructing the PostData argument correctly?
I also tried converting the PostData string to a byte array. But there is
not Variant constructor for type byte[]. So could not send a byte array as a
variant in the parameters list.
TIA
Shardul
|
|
|
Powered by
FUDForum. Page generated in 0.03268 seconds