Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\TCPIP6\Parameters]

"DisabledComponents"=dword:000000ff


Empty 發表在 痞客邦 留言(0) 人氣()

asp.net 2.0 使用 

在PostBack後網頁通常會回到最頂端的位置,下面三個方式可以讓單頁或整個Web或目錄PostBack後回到原來停留的位置.

1. Web.config

1 //在<system.web></system.web>之間增加節點
2 <pages maintainScrollPositionOnPostBack="true"></pages>

Empty 發表在 痞客邦 留言(0) 人氣()

 

Function ContainsChtString(str) As Boolean
02     '檢查字串是否包含中文或全形字
03     Dim As Integer
04     Dim Rc As Boolean

Empty 發表在 痞客邦 留言(0) 人氣()

A potentially dangerous Request.Form value was detected from the client (ctl00$MainContent$txtCode="<code></code>"). 

Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. To allow pages to override application request validation settings, set requestValidationMode="2.0" in the configuration section. After setting this value, you can then disable request validation by setting validateRequest="false" in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. For more information, see http://go.microsoft.com/fwlink/?LinkId=153133. 

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (ctl00$MainContent$txtCode="<code></code>").

Empty 發表在 痞客邦 留言(0) 人氣()

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

Oracle, SQL Server and MySQL support isolation levels. During an operation, the database engine places certain locks to maintain data integrity. Different types of locking apply to different databases (Oracle vs. MySQL), or table types (eg. MyISAM vs. InnoDB).

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.

Empty 發表在 痞客邦 留言(0) 人氣()

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."

Advanced Settings

Empty 發表在 痞客邦 留言(0) 人氣()

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;
資料表解除鎖定 


Empty 發表在 痞客邦 留言(0) 人氣()

前一陣子,因為突然停電的關係,電腦突然關機,再重新啟動後,進入 phpMyadmin 中時,就看到 plog 某些資料表在使用中,無法做更新,試圖修改時,會出現這樣的訊息:

Can't open file: 'xxx.MYI'. (errno: 144)

解決方法

    myisamchk -f xxx.MYI 就可以修復了。

    Empty 發表在 痞客邦 留言(0) 人氣()

    xcopy 【源目录】【目标目录】/s /e /h
    /s 复制非空的目录和子目录。如果省略 /s,xcopy 将在一个目录中工作。
    /e 复制所有子目录,包括空目录。
    /h 复制具有隐藏和系统文件属性的文件。默认情况下,xcopy 不复制隐藏或系统文件。 

    Empty 發表在 痞客邦 留言(0) 人氣()

    好吧!這一次真的是我太嫩了!短短接觸 .NET 平台雖然不到半年,我這次認栽了!

    • TextBox 如果把 ReadOnly 屬性設定為 True,透過 JavaScript 設定的值,在 ASP.NET 2.0 是無法取到值的!

    今天,就為了這小小的 Bug,不知道浪費多久的時間,殺死了多少的腦細胞!唉!只能說我還是太嫩了,寫的程式不夠多!還以為真的是七月,見到鬼了,一行一行 trace,明明眼看 TextBox 中有值,卻無法取用!幸好, Google 讓我搜尋到解答,早在 2005 的時候,就有人提出解決辦法了!Orz

    解決之道:

    1. 利用 Request 來取值。
    2. 如果非要使用 textBox.Text 來取值的話,textBox. ReadOnly 記的還是設為 false 。但是在 Page_Load,加入 textBox.Attributes.Add("ReadOnly", "ReadOnly") 即可。

    Empty 發表在 痞客邦 留言(0) 人氣()