- Oct 08 Wed 2014 08:04
IIS8.0無法正常顯示圖片內容
- Oct 07 Tue 2014 11:50
上傳檔案,避免檔名重覆
string path = @"d:\upload\";
if (FileUpload1.HasFile)
- Oct 02 Thu 2014 09:55
利用ASP.NET加密和解密Web.config中連接字串
大多數情況下,我都把資料庫的連接字串放在了web.config中。其中包含許多敏感資訊,包括連接資料庫的使用者名密碼等。然而我們在web.config和machine.config中以純文字的方式保存密碼安全嗎?
- Oct 02 Thu 2014 09:40
如何取得站台相關資訊
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
- Oct 02 Thu 2014 09:12
讓所有的textbox的內容一次性的清除
foreach (Control c in Page.Form.Controls)
{
- Sep 30 Tue 2014 08:54
WebForms UnobtrusiveValidationMode 需要 'jquery' 的 ScriptResourceMapping。請加入 ScriptResourceMapping 命名的 jquery
- Sep 29 Mon 2014 11:11
文字框textbox輸入完文字之後,會變色
myTextBox.Attributes.Add("onchange", "this.style.backgroundColor = 'yellow';");
- Sep 29 Mon 2014 10:47
點擊一下文字框,可以讓TextBox內容消失
TextBox1.Attributes.Add("OnClick", "this.value = '';");
- Sep 28 Sun 2014 22:49
插入記錄後,馬上取得被插入記錄的主鍵 id
SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["schoolConnectionString"].ConnectionString);
conn.Open();