c# asp.net 获取客户端表单的数据
在web程序中,经常会使用在一个网页使用其他网页提交的数据信息,这里可以使用Request内置对象来完成,来获取用户提交的信息,根据客户端提交数据方式的不同,Request对象分别使用Form和QueryString集合属性来获取数据。下面是两种集合获取方式的不同点:通过Form获取数据时在form属性中简单的添加action=“跳转的网页地址”,<form. ID="id号 " runat=“sever” action=“要跳转的网页URL”> </form>,该传参方式是隐式的,不容易暴露;另一种方式是通过get方法提交表单数据,或页面导向通过“URL?Parameter=Value”格式传递参数值时,即使用Request对象QueryString属性获取传递过来的信息,这个传参方式一般不建议使用,因在URL之后,所以容易在浏览器暴露参数,容易遭受黑客的攻击,再者是URL的字节数有限,即传递的参数有限,所以不建议使用QueryString。
这里需要建立两个web程序页,第一个Default.aspx页中运用各种控件,第二个是在get-form.aspx的后台代码中在页面加载的时候获得Default.aspx页中,用户提交的信息数据。
Default.aspx的html代码:
view source
< id="highlighter_304109_clipboard" title="copy to clipboard" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="16" height="16" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" type="application/x-shockwave-flash">
print?
01
<PREclass=brush:csharp><%@ Page Language="C#"AutoEventWireup="true"CodeBehind="Default.aspx.cs"Inherits="form._Default"%>
02
03
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
04
05
<html xmlns="http://www.w3.org/1999/xhtml">
06
<head runat="server">
07
<title>无标题页</title>
08
</head>
09
<body>
10
<form. id="Form1"action="get_form.aspx"method="post">
11
<div style="text-align:center">
12
填写用户信息
13
<hr style="size:50%"/>
14
&
相关文档:
本篇文章介绍了在ASP.Net 2.0如何做窗体身份验证,并且讲解了IIS和ASP.Net2.0窗体身份验证机制是如何结合在一起的。我们还会详细讲解一下2.0中关于窗体身份验证的一个类:FormsAuthenticationModule。
l 综述
当某一个用户使用用户名成功登陆网站时,FormsAuthenticatio ......
Unix时间戳最小单位是秒,开始时间为格林威治标准时间1970-01-01 00:00:00
ConvertIntDateTime方法的基本思路是通过获取本地时区表示Unixk开始时间,加上Unix时间值(即过去的秒数).
ConvertDateTimeInt方法的基本思路是通过刻度数差,再把刻度数转换为秒数,当然要说明的是,我这里返回的是double类型,意义上并非是真 ......
Backup.aspx
protected void Button1_Click(object sender, EventArgs e)
{
string path = Server.MapPath("") + @"\Backup";
if (!Directory.Exists(path))
......
DateTime dt = DateTime.Now;
// Label1.Text = dt.ToString();//2005-11-5 13:21:25
// Label2.Text = dt.ToFileTime().ToString();//127756416859912816
// Label3.Text = dt.ToFileTimeUtc().ToString();//127756704859912816
// Label4.Text = dt.ToLocalTime().ToString();//2005-11-5 21:21:25
// Label5.Text = ......