- 8月 20 週六 201112:27
Learn C Language
- 3月 31 週一 200814:41
TQuery.Locate使用方式

function Locate(const KeyFields: String; const KeyValues: Variant; Options: TLocateOptions): Boolean;
可區分「單一欄位查詢」與「多欄位查詢」
單一欄位查詢
strCode:='Abc'
Tquery1.Locate('code',strcode,[loCaseInsensitive]) 这样TQuery,就会将光标定位到code字段中等于Abc(abc,aBc,abC,....)的记录上。 不过,我们既然用来查询大部分情况下我们都是要模糊查询的,所以这样并不是我们要用的方法,我们只要稍微改下Option就OK了。
Tquery1.Locate('code',strcode,[loPartialKey])
- 3月 12 週三 200817:03
DELPHI设置文件的属性

API
SetFileAttributes(文件名,FILE_ATTRIBUTE_HIDDEN),
或者SetFileAttributes(文件名,6),
DELPHI函数:
1. 在interface下的uses中引用filectrl单元。
2. filesetattr('filename',DELPHI常量)
例如:
filesetattr('my.doc',fareadonly)//改成只读
filesetattr('my.doc',fareadonly+faarchive)//成为只读和存档
- 6月 20 週三 200714:23
PHP 判斷作業系統;Script 判斷瀏覽器
◆PHP 判斷作業系統
if (strtoupper(substr(PHP_OS,0,3)=='WIN')) {
$eol="\r\n";
} elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) {
$eol="\r";
if (strtoupper(substr(PHP_OS,0,3)=='WIN')) {
$eol="\r\n";
} elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) {
$eol="\r";
- 5月 24 週四 200713:24
TEmbeddedWB 讓 WebBrowser 當出現 forbidden 錯誤時不要在顯示 Dialog

TEmbeddedWB 讓 WebBrowser 當出現 forbidden 錯誤時不要在顯示 Dialog
procedure TForm1.EmbeddedWB1forbiddenError(Sender: TObject; ErrorLine,
ErrorCharacter, ErrorCode, ErrorMessage, ErrorUrl: String;
var Continueforbidden, Showdialog: Boolean);
begin
Continueforbidden :=true;//繼續執行腳本
Showdialog :=false; //不顯示腳本錯誤訊息視窗
end;
- 5月 18 週五 200716:29
讓跳出來的網頁視窗持續在最上層

window.showModelessDialog("xxx.htm");
onBlur="setTimeout('self.focus()', 200);"
若有兩個以上的網頁同時被開啟,那可是會亂成一團的喔!
- 5月 18 週五 200715:27
php檢查Server的Port是否能正常連線
host能輸入domain跟ip
持續改進中....接下來udp跟ssl連線也都要可以測
給它主機名稱跟port,如果正常連線會傳回ture失敗傳回false,監測時間大概一秒鐘,超過則算失敗
function chkservice($host, $port)
{
if (ini_get('display_errors')==1){ //判斷ini的display errors的設定
$ch_ini_display=1;
ini_set('display_errors', 0);//設定連線錯誤時不要display errors
}
$hostip = gethostbyname($host); //檢查輸入的host name dns正解
if (!$x = fsockopen($hostip, $port, $errno, $errstr, 1)) //測試連線
{
return false;
}
else
{
return ture;
if ($x){fclose($x); //關閉連線,好寶寶都會養成的好習慣,也不知道有沒有用
}
}
if ($ch_ini_display==1) ini_set('display_errors', 1); //將ini的display error設定改回來
}
持續改進中....接下來udp跟ssl連線也都要可以測
給它主機名稱跟port,如果正常連線會傳回ture失敗傳回false,監測時間大概一秒鐘,超過則算失敗
function chkservice($host, $port)
{
if (ini_get('display_errors')==1){ //判斷ini的display errors的設定
$ch_ini_display=1;
ini_set('display_errors', 0);//設定連線錯誤時不要display errors
}
$hostip = gethostbyname($host); //檢查輸入的host name dns正解
if (!$x = fsockopen($hostip, $port, $errno, $errstr, 1)) //測試連線
{
return false;
}
else
{
return ture;
if ($x){fclose($x); //關閉連線,好寶寶都會養成的好習慣,也不知道有沒有用
}
}
if ($ch_ini_display==1) ini_set('display_errors', 1); //將ini的display error設定改回來
}
- 5月 18 週五 200715:24
Delphi 的版本及其對應的編譯器版本
Delphi 11 (Delphi 2007或RAD Studio 5.0)
DCC32.EXE 的檔案版本編號 11.0.2627.5503
CodeGear Delphi for Win32 compiler version 18.5
{VER185} ==> 所以由此可知 Delphi 2007 與 Delphi 2006 所更新的 Win32 編譯器其實沒有差太多!!
Delphi 10 (Delphi 2006或BDS 4.0)
DCC32.EXE 的檔案版本編號 10.0.2418.27083
Borland Delphi for Win32 compiler version 18.0
{VER180}
Delphi 9 (Delphi 2005或BDS 3.0)
DCC32.EXE 的檔案版本編號 9.X
Borland Delphi for Win32 compiler version 17.0
{VER170}
Delphi 7
DCC32.EXE 的檔案版本編號 7.0.8.1
Borland Delphi Version 15.0
{VER150}
如果在程式中有用到要判斷目前的 Delphi 的版本編號的話,用 VERnnn
{$IFDEF VER180}
ShowMessage('Delphi2006');
{$ENDIF}
目前這個最常被的地方:
1、元件
2、當程式是在各版本上需有不同的執行結果
3、當各版本在昇級後, Function 放置的 Unit 已經改變時
DCC32.EXE 的檔案版本編號 11.0.2627.5503
CodeGear Delphi for Win32 compiler version 18.5
{VER185} ==> 所以由此可知 Delphi 2007 與 Delphi 2006 所更新的 Win32 編譯器其實沒有差太多!!
Delphi 10 (Delphi 2006或BDS 4.0)
DCC32.EXE 的檔案版本編號 10.0.2418.27083
Borland Delphi for Win32 compiler version 18.0
{VER180}
Delphi 9 (Delphi 2005或BDS 3.0)
DCC32.EXE 的檔案版本編號 9.X
Borland Delphi for Win32 compiler version 17.0
{VER170}
Delphi 7
DCC32.EXE 的檔案版本編號 7.0.8.1
Borland Delphi Version 15.0
{VER150}
如果在程式中有用到要判斷目前的 Delphi 的版本編號的話,用 VERnnn
{$IFDEF VER180}
ShowMessage('Delphi2006');
{$ENDIF}
目前這個最常被的地方:
1、元件
2、當程式是在各版本上需有不同的執行結果
3、當各版本在昇級後, Function 放置的 Unit 已經改變時
- 5月 16 週三 200720:36
Delphi 發生『找不到重要的DLL檔-QTINTF.DLL』錯誤訊息
Delphi 封裝應用程式後,在某些PC上會發生『找不到重要的DLL檔-QTINTF.DLL』錯誤訊息
==========================
避免uses 一些QXXX.pas
其需要連結qtintf.Dll
有些作業系統無此DLL
==========================
避免uses 一些QXXX.pas
其需要連結qtintf.Dll
有些作業系統無此DLL
- 5月 16 週三 200719:25
Delphi Run Project 時得知程式在載入DLL或EVENT
◆ 可取得 Modules
在程式執行時,只要按 Ctrl + Alt + M ,就可以知道在程式執行的時侯,
到底Load了那些Dll囉!
◆ 可取得 EventLos
在程式執行時,只要按 Ctrl + Alt + V
在程式執行時,只要按 Ctrl + Alt + M ,就可以知道在程式執行的時侯,
到底Load了那些Dll囉!
◆ 可取得 EventLos
在程式執行時,只要按 Ctrl + Alt + V
