大多數情況下,我都把資料庫的連接字串放在了web.config中。其中包含許多敏感資訊,包括連接資料庫的使用者名密碼等。然而我們在web.config和machine.config中以純文字的方式保存密碼安全嗎?
大多數情況下,我都把資料庫的連接字串放在了web.config中。其中包含許多敏感資訊,包括連接資料庫的使用者名密碼等。然而我們在web.config和machine.config中以純文字的方式保存密碼安全嗎?
ALL_HTTP=HTTP_CONNECTION:keep-alive HTTP_ACCEPT:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 HTTP_ACCEPT_ENCODING:gzip,deflate,sdch HTTP_ACCEPT_LANGUAGE:zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4 HTTP_COOKIE:ASP.NET_SessionId=0usysbeqslyprqpc20htxh5z HTTP_HOST:localhost:64821 HTTP_USER_AGENT:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36
ALL_RAW=Connection: keep-alive Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Encoding: gzip,deflate,sdch Accept-Language: zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4 Cookie: ASP.NET_SessionId=0usysbeqslyprqpc20htxh5z Host: localhost:64821 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36
APPL_MD_PATH=/LM/W3SVC/17/ROOT
APPL_PHYSICAL_PATH=C:\Users\yingling\Documents\Visual Studio 2013\Chapter14\
AUTH_TYPE=
AUTH_USER=
AUTH_PASSWORD=
LOGON_USER=
REMOTE_USER=
CERT_COOKIE=
CERT_FLAGS=
CERT_ISSUER=
CERT_KEYSIZE=
CERT_SECRETKEYSIZE=
CERT_SERIALNUMBER=
CERT_SERVER_ISSUER=
CERT_SERVER_SUBJECT=
CERT_SUBJECT=
CONTENT_LENGTH=0
CONTENT_TYPE=
GATEWAY_INTERFACE=CGI/1.1
HTTPS=off
HTTPS_KEYSIZE=
HTTPS_SECRETKEYSIZE=
HTTPS_SERVER_ISSUER=
HTTPS_SERVER_SUBJECT=
INSTANCE_ID=17
INSTANCE_META_PATH=/LM/W3SVC/17
LOCAL_ADDR=::1
PATH_INFO=/Default12.aspx
PATH_TRANSLATED=C:\Users\yingling\Documents\Visual Studio 2013\Chapter14\Default12.aspx
QUERY_STRING=
REMOTE_ADDR=::1
REMOTE_HOST=::1
REMOTE_PORT=39823
REQUEST_METHOD=GET
SCRIPT_NAME=/Default12.aspx
SERVER_NAME=localhost
SERVER_PORT=64821
SERVER_PORT_SECURE=0
SERVER_PROTOCOL=HTTP/1.1
SERVER_SOFTWARE=Microsoft-IIS/8.0
URL=/Default12.aspx
HTTP_CONNECTION=keep-alive
HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_ACCEPT_ENCODING=gzip,deflate,sdch
HTTP_ACCEPT_LANGUAGE=zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4
HTTP_COOKIE=ASP.NET_SessionId=0usysbeqslyprqpc20htxh5z
HTTP_HOST=localhost:64821
HTTP_USER_AGENT=Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36
foreach (Control c in Page.Form.Controls)
{
myTextBox.Attributes.Add("onchange", "this.style.backgroundColor = 'yellow';");
TextBox1.Attributes.Add("OnClick", "this.value = '';");
SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["schoolConnectionString"].ConnectionString);
conn.Open();
ViewState["prevUrl"] = Request.UrlReferrer.ToString();
假設我們的網址為http://demo.tc/Default3.aspx?id=1019&uu=77
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
{
using System;
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System;
using System.Collections.Generic;
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="listview_2.aspx.cs" Inherits="listview_2" MaintainScrollPositionOnPostback="true" %>
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
using System;
using System.Collections.Generic;