The text box name must be the name on the Web page you want to log on to. If the source code is not working, you can use vsniffer to check it.
The following code obtains the login information entered by the user:
String name;
Name = request. querystring ["emailname"];
Try
{
Int A = Name. indexof ("@", 0, name. Length );
F_user.value = Name. substring (0, );
F_domain.value = Name. substring (a + 1, name. Length-(A + 1 ));
F_pass.value = request. querystring ["psw"];
}
Catch
{
Script. Alert ("wrong email! ");
Server. Transfer ("index. aspx ");
}
35. Warning window
/** // <Summary>
/// The alert dialog box is displayed on the server.
/// </Summary>
/// <Param name = "str_message"> message. For example, "cannot be blank! "</Param>
/// <Param name = "page"> page class </param>
Public void alert (string str_message, page)
{
Page. registerstartupscript ("", "<SCRIPT> alert ('" + str_message + "'); </SCRIPT> ");
}
36. reload this warning window to make a control focus
/** // <Summary>
/// The alert dialog box pops up on the server side, and the control gets focus
/// </Summary>
/// <Param name = "str_ctl_name"> obtain the focus Control ID value, for example, txt_name </param>
/// <Param name = "str_message"> message. For example, enter your name! "</Param>
/// <Param name = "page"> page class </param>
Public void alert (string str_ctl_name, string str_message, page)
{
Page. registerstartupscript ("", "<SCRIPT> alert ('" + str_message + "'); document. forms (0 ). "+ str_ctl_name + ". focus (); document. forms (0 ). "+ str_ctl_name + ". select (); </SCRIPT> ");
}
37. confirmation dialog box
** // <Summary>
/// The confirm dialog box is displayed on the server.
/// </Summary>
/// <Param name = "str_message"> message, for example, "Are you sure you want to delete it! "</Param>
/// <Param name = "BTN"> hide the id value of the botton button, for example, btn_flow </param>
/// <Param name = "page"> page class </param>
Public void confirm (string str_message, string BTN, page)
{
Page. registerstartupscript ("", "<SCRIPT> If (confirm ('" + str_message + "') = true) {document. forms (0 ). "+ Btn + ". click () ;}</SCRIPT> ");
}
38. In the reload confirmation dialog box, click OK to trigger a hidden button event, and click Cancel to trigger a hidden button event.
/** // <Summary>
/// The confirm dialog box pops up on the server, asking the user about the operations to be switched to, including the operations for "OK" and "cancel"
/// </Summary>
/// <Param name = "str_message"> the message is displayed. For example, if "data is added successfully, click OK to enter the process and click Cancel to modify data." </param>
/// <Param name = "btn_redirect_flow"> "OK" button id value </param>
/// <Param name = "btn_redirect_self"> "cancel" button id value </param>
/// <Param name = "page"> page class </param>
Public void confirm (string str_message, string btn_redirect_flow, string btn_redirect_self, page)
{
Page. registerstartupscript ("", "<SCRIPT> If (confirm ('" + str_message + "') = true) {document. forms (0 ). "+ btn_redirect_flow + ". click ();} else {document. forms (0 ). "+ btn_redirect_self + ". click () ;}</SCRIPT> ");
}