Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\TCPIP6\Parameters]
"DisabledComponents"=dword:000000ff
- Nov 24 Wed 2010 23:25
[windows 7以上] 移除ipV6
- Nov 18 Thu 2010 00:45
[ASP.NET][Page] 網頁PostBack後回到原來停留的位置
asp.net 2.0 使用
在PostBack後網頁通常會回到最頂端的位置,下面三個方式可以讓單頁或整個Web或目錄PostBack後回到原來停留的位置.
1. Web.config
1 |
//在<system.web></system.web>之間增加節點 |
2 |
<pages maintainScrollPositionOnPostBack= "true" ></pages> |
- Nov 17 Wed 2010 05:34
[VB6]檢查字串是否有中文或全形字
Function ContainsChtString(str) As Boolean |
02 |
'檢查字串是否包含中文或全形字 |
03 |
Dim i As Integer |
04 |
Dim Rc As Boolean |
- Nov 09 Tue 2010 22:04
ASP.NET 4.0验证请求 A potentially dangerous Request.Form value was detected from the client (ctl00$MainC
A potentially dangerous Request.Form value was detected from the client (ctl00$MainContent$txtCode="<code></code>").
Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (ctl00$MainContent$txtCode="<code></code>").
- Nov 06 Sat 2010 12:47
WITH (NOLOCK) table hint equivalent for MySQL
I don’t remember how many times I was asked about an equivalent term of the infamous “NOLOCK” hint for mysql database server, hence I thought it was worth to write about it here. “WITH (NOLOCK)” is a transaction isolation levels that defines how data is available during an update, or with other words it is a property that defines at what point changes made by an update operation will become available in a row, table or database to other processes.
The official SQL standard defines four isolation levels:
READ COMMITTED
READ UNCOMMITTED
REPEATABLE READ
SERIALIZABLE
When WITH (NOLOCK) is used with SQL Server, the statement does not place a lock nor honor exclusive locks on table. The MySQL equivalent is READ UNCOMMITTED, also known as “dirty read” because it is the lowest level of isolation. If we specify a table hint then it will override the current default isolation level. MySQL default isolation level is REPEATABLE READ which means locks will be placed for each operation, but multiple connections can read data concurrently.
- Nov 06 Sat 2010 12:46
HTTP Error 404.17 - PHP on IIS7 under 64bit Vista
If you're getting...
"HTTP Error 404.17 - Not Found - The requested content appears to be script and will not be served by the static file handler."
...on Vista while trying to get PHP working under IIS7 with the standard ISAPI "php5isapi.dll" ask yourself, are you running 64-bit? That ISAPI DLL is a 32-bit DLL, so you'll have to either change your default Application Pool to enable 32-bit, or preferably create a separate 32-bit AppPool for your PHP Application.
Right click on the Application Pool and select "Advanced Settings" then "Enable 32-bit Applications."
- Nov 06 Sat 2010 12:45
MySQL 基本操作語法
net start mysql
啟動 MySQL
查詢資料庫、資料表、欄位等資訊
mysqlshow [-h ipAddress] -u user_name -p
mysqlshow -u user_name@ipAddress -p
列出所有資料庫
mysqlshow -u user_name -p db_name
列出該 database_name 所有資料表
mysqlshow -u user_name -p db_name table_name
列出該 database_name 裡 table_name 資料表裡的欄位
mysqlshow -u user_name -p db_name table_name field_name
列出該 database_name 裡 table_name 的 field_name 的欄位資訊
更改密碼
mysqladmin password 'new_password'
更改目前系統登入使用者的密碼
於資料庫中導入執行sql script 檔
mysql db_name < sql_filename.sql
與 MySQL 連線
mysql [-h ipAddress] -u user_name -ppassword
mysql [-h ipAddress] -u user_name -p
切換使用資料庫 database_name
mysql> USE db_name
mysql> SELECT DATABASE();
列出目前預設的資料庫名稱
mysql> SHOW DATABASES;
列出所有資料庫
mysql> SHOW DATABASES LIKE 'my%';
列出所有資料庫名稱為 my 開頭的
mysql> SHOW TABLES FROM db_name [LIKE ...];
列出該資料庫所有資料表名稱
mysql> SHOW COLUMNS FROM table_name [LIKE ...];
mysql> SHOW COLUMNS FROM table_name FROM db_name [LIKE ...];
mysql> SHOW FIELDS FROM table_name [LIKE ...];
mysql> DESCRIBE table_name ;
mysql> EXPLAIN table_name ;
列出該資料表所有欄位名稱
mysql> SHOW INDEX FROM table_name [LIKE ...];
mysql> SHOW INDEX FROM table_name FROM db_name [LIKE ...];
mysql> SHOW KEY FROM table_name [LIKE ...];
列出該資料表所有索引資訊
mysql> SHOW TABLE STATUS;
mysql> SHOW TABLE STATUS FROM db_name [LIKE ...];列出資料表的相關資訊
mysql> SHOW VARIABLES [LIKE ...];
顯示 MySQL 相關參數設定
mysql> SHOW VARIABLES LIKE '%character%' ;
顯示資料庫語系設定資訊
mysql> SHOW PROCESSLIST;
列出與 MySQL 連線的 threads 狀態
mysql> SHOW STATUS;
列出與 MySQL 目前的狀態
當進行資料表檢查或修補時,鎖定資料表可確保資料表的安全
(READ:唯讀狀態、WRITE:無法寫入也無法讀取)
mysql> LOCK TABLE table_name READ;
mysql> FLUSH TABLES;
鎖定資料表
mysql> UNLOCK TABLE;
資料表解除鎖定
- Nov 04 Thu 2010 20:56
MySQL error (errno: 144)
前一陣子,因為突然停電的關係,電腦突然關機,再重新啟動後,進入 phpMyadmin 中時,就看到 plog 某些資料表在使用中,無法做更新,試圖修改時,會出現這樣的訊息:
解決方法Can't open file: 'xxx.MYI'. (errno: 144)
myisamchk -f xxx.MYI 就可以修復了。
- Nov 03 Wed 2010 10:16
Xcopy指令
xcopy 【源目录】【目标目录】/s /e /h
/s 复制非空的目录和子目录。如果省略 /s,xcopy 将在一个目录中工作。
/e 复制所有子目录,包括空目录。
/h 复制具有隐藏和系统文件属性的文件。默认情况下,xcopy 不复制隐藏或系统文件。
- Nov 01 Mon 2010 23:20
TextBox 設定 ReadOnly 無法取值
好吧!這一次真的是我太嫩了!短短接觸 .NET 平台雖然不到半年,我這次認栽了!
- TextBox 如果把 ReadOnly 屬性設定為 True,透過 JavaScript 設定的值,在 ASP.NET 2.0 是無法取到值的!
今天,就為了這小小的 Bug,不知道浪費多久的時間,殺死了多少的腦細胞!唉!只能說我還是太嫩了,寫的程式不夠多!還以為真的是七月,見到鬼了,一行一行 trace,明明眼看 TextBox 中有值,卻無法取用!幸好, Google 讓我搜尋到解答,早在 2005 的時候,就有人提出解決辦法了!Orz
解決之道:
- 利用 Request 來取值。
- 如果非要使用 textBox.Text 來取值的話,textBox. ReadOnly 記的還是設為 false 。但是在 Page_Load,加入 textBox.Attributes.Add("ReadOnly", "ReadOnly") 即可。