我成功地测试了这段代码,但它只适用于 PHP,如果我从 ASP 中输入 TextBox 的名称,它就不起作用。对于 ASP.NET 的任何帮助,我将不胜感激
if (![nameInput.text isEqual: @""] && ![passInput.text isEqual: @""])
{
NSString *postString = [NSString stringWithFormat:@"name0=%@&name1=%@", nameInput.text, passInput.text];
NSData *data = [postString dataUsingEncoding:NSASCIIStringEncoding];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://www.ucimsewebu.eu/info.php"]];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:data];
[webView loadRequest:request];
}
这是 ASP 文本框代码
<tr>
<td>
<span id="cphmain_LabelJmeno">Přihlašovací jméno:</span></td>
<td>
<input name="ctl00$cphmain$TextBoxjmeno" type="text" id="cphmain_TextBoxjmeno" />
</td>
</tr>
<tr>
<td>
<span id="cphmain_LabelHeslo">Heslo:</span></td>
<td>
<input name="ctl00$cphmain$TextBoxHeslo" type="password" id="cphmain_TextBoxHeslo" title="heslo" />
</td>
</tr>
<tr>