我当前的 .net 代码(不起作用):
Dim w As New Net.WebClient
Dim values As New Specialized.NameValueCollection
values.Add("username", "toto")
values.Add("password", "totopassword")
w.UploadValues("http://www.webadresse.com", values)
w.DownloadString("http://webadresse.com")
我怎样才能登录到这个:
<form>
<input type="text" value="username">
<input type="text" value="password">
<a href="#" onclick="javascript: submitFormMaster();">
</form>
和 javascript :
var inputUserName = new Ext.form.TextField({
id : "username",
el : "username",
fieldLabel : stringMaster23,
itemCls : "text_authentification",
labelSeparator : "",
allowBlank : false,
autoCreate : {
tag : "input",
type : "text",
size : "18",
autocomplete : "on",
maxlength : "50"
}
});
var inputPassword = new Ext.form.TextField({
id : "password",
el : "password",
fieldLabel : stringMaster24,
itemCls : "text_authentification",
labelSeparator : "",
allowBlank : false,
autoCreate : {
tag : "input",
type : "password",
size : "18",
autocomplete : "on",
maxlength : "20"
}
});
var radioGroupPrice = new Ext.form.RadioGroup({
id : "GroupPrice",
vertical : true,
items : [ {
name : "displayPrice",
boxLabel : stringMaster25,
itemCls : "text_radio_price",
inputValue : "false"
}, {
name : "displayPrice",
boxLabel : stringMaster26,
itemCls : "text_radio_price",
inputValue : "true",
checked : true
} ]
});
var renderSubmit = new Ext.form.Label(
{
id : "RenderSubmit",
name : "RenderSubmit",
html : '<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="right" valign="middle"><a href="/ecran/password_lost.asp" class="text_link">'
+ stringMaster27
+ ' ?</a></td><td> </td><td width="43" align="center" valign="middle"><a href="#" onclick="javascript: submitFormMaster();"><img src="'
+ urlBtnOK
+ '" width="43" height="19" title="'
+ stringMaster29
+ '" alt="'
+ stringMaster29
+ '" border="0" /></a></td></tr></table>'
});
var formMaster = new Ext.form.FormPanel({
id : "FAuthentication",
title : "",
baseCls : "base-cls-override",
cls : "form_authentication_bis",
standardSubmit : true,
frame : true,
width : 210,
labelWidth : 1,
defaultType : "textfield",
items : [ inputUserName, inputPassword, {
xtype : "fieldset",
autoHeight : true,
border : false,
style : "padding: 0px 0px 0px 0px",
layout : "column",
items : [ radioGroupPrice ]
}, renderSubmit ],
keys : [ {
key : Ext.EventObject.ENTER,
fn : submitFormMaster
} ],
listeners : {
afterrender : function() {
loadFormData();
}
}
});
function submitFormMaster() {
if (formMaster.getForm().isValid()) {
if (!formMaster.getForm().getEl().isMasked()) {
formMaster.getForm().getEl().dom.method = "POST";
formMaster.getForm().getEl().dom.action = applicationPath
+ currentCulture + "/Authentication";
formMaster.getForm().submit();
}
formMaster.getForm().getEl().mask(stringMaster37);
}
}
function loadFormData() {
if (warnPopupMaster != "") {
Ext.Msg.alert(stringMaster29Bis, warnPopupMaster);
}
}
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = "side";
Ext.onReady(function() {
formMaster.render("AuthenticationForm");
Ext.getCmp("username").focus("", 10);
});