Time of Update: 2018-12-05
拖三個組件: memo ,idhttp,edit 加一個Button然後在procedure TForm1.Button1Click(Sender: TObject);裡加上一句話1.可以這麼寫memo1.Text:= idHTTP1.Get(edit1.Text);2.也可以這麼寫memo1.Lines.Add(IdHTTP1.Get(edit1.Text));這件事就這麼簡單.不過,別用它來試百度,因為百度屏蔽了 ‘Indy Library’ 這個用戶端標識的。hehe,除非修改http頭
Time of Update: 2018-12-05
TBucketList和TObjectBucketList類 從Delphi6開始,VCL的Contnrs單元中又增加了兩個新的容器類TBucketList和TObjectBucketList。TBucketList實際上也是一個簡單基於雜湊表的指標-指標對列表。介面定義如下: TBucketList = class(TCustomBucketList)… public destructor Destroy; override; procedure Clear; function
Time of Update: 2018-12-05
在 Delphi 中使用Regex, 目前 PerlRegEx 應該是首選, 準備徹底而細緻地研究它.官方網站: http://www.regular-expressions.info/delphi.html直接下載: http://www.regular-expressions.info/download/TPerlRegEx.zip安裝方法:1、先把解壓的 TPerlRegEx 檔案夾放一個合適的地方, 我放在了 Delphi 的 Imports 目錄中.2、目前最新 For Win32
Time of Update: 2018-12-05
看一個指標用法的例子: 1 var 2 X, Y: Integer; // X and Y 整數類型 3 P: ^Integer; // P 指向整數類型的指標 4 begin 5 X :=17; // 給 X 賦值
Time of Update: 2018-12-05
try//嘗試執行 {SomeCode} except//出錯的時候執行, Except有特定的錯誤類型 {SomeCode} end; try//嘗試執行{SomeCode} finally//無論如何都強制執行{SomeCode} end; 例:tryAge:=StrToInt(Edit1.Text);ShowMessage(Format('生於%d年',[YearOf(Now)-Age]));excepton EConvertError
Time of Update: 2018-12-05
//尋找是否存在varreg: TPerlRegEx;beginreg := TPerlRegEx.Create(nil);reg.Subject := 'CodeGear Delphi 2007 for Win32';reg.RegEx := '\d';if reg.Match then ShowMessage('找到了')else ShowMessage('沒找到');FreeAndNil(reg);end;----------------------------------
Time of Update: 2018-12-05
//開啟控制台io.open() t={};//table插入元素table.insert(t,"windows");table.insert(t,"linux");table.insert(t,"unix");for(k,v in t){ io.print(v);}t1={};t1[1]=11;t1[2]=22;t1[3]=33;//範型輸出table元素 for(k,v in t1){ io.print(v);}t2={};t2["windows"]=100;t2["linux"]="字串2
Time of Update: 2018-12-05
Private Sub Command1_Click() Text2.Text = URLEncode(Text1.Text) End Sub Public Function URLEncode(ByRef strURL As String) As String Dim I As Long Dim tempStr As String For I = 1 To Len(strURL) If Asc(Mid(strURL, I, 1)) < 0 Then tempStr = "%" &
Time of Update: 2018-12-05
Function GBtoUTF8(szInput)Dim wch, uch, szRetDim xDim nAsc, nAsc2, nAsc3'如果輸入參數為空白,則退出函數If szInput = "" ThenGBtoUTF8 = szInputExit FunctionEnd If'開始轉換For x = 1 To Len(szInput)wch = Mid(szInput, x, 1)nAsc = AscW(wch)If nAsc < 0 Then nAsc = nAsc + 6
Time of Update: 2018-12-05
字元描述\標記下一個字元是特殊字元或文字。例如,"n" 和字元 "n" 匹配。"\n" 則和換行字元匹配。序列 "\\" 和 "\" 匹配,而 "\(" 則和 "(" 匹配。^匹配輸入的開頭。$匹配輸入的末尾。*匹配前一個字元零或多次。例如,"zo*" 與 "z" 或 "zoo" 匹配。+匹配前一個字元一次或多次。例如,"zo+" 與 "zoo" 匹配,但和 "z" 不匹配。?匹配前一個字元零或一次。例如,"a?ve?" 和 "never" 中的 "ve"
Time of Update: 2018-12-05
原始碼如下:unit Unit2;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtrls, SHDocVw;type TForm2 = class(TForm) WebBrowser1: TWebBrowser; Button1: TButton; ListBox1: TListBox;
Time of Update: 2018-12-05
Internet Transfer 控制項實現了兩種廣泛使用的 網際網路通訊協定 (IP): 超文本傳送協議(HyperText Transfer Protocol)(HTTP) 和檔案傳送協議(File Transfer Protocol) (FTP)。使用 Internet Transfer 控制項可以通過 OpenURL 或 Execute 方法串連到任何使用這兩個協議的網站並檢索檔案。 可能的用途 在應用程式中添加 FTP 瀏覽器。 建立自動從公用 FTP 網站下載檔案的應用程式。
Time of Update: 2018-12-05
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP; type TForm1 = class(TForm) Button1: TButton;
Time of Update: 2018-12-05
Delphi的類聲明有兩種方法,一種是繼承了Delphi的內建類的聲明,另一種則是完全自訂的類聲明。這兩種類的區別不僅在於聲明程式的不同,還會影響到對象實體的記憶體管理。 1 unit Unit1; 2 3 interface 4 5 uses 6 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 7 Dialogs, StdCtrls, Buttons; 8 9 type10
Time of Update: 2018-12-05
從小到大,不知經曆過多少次考試,大多數時候要考英語。像我這樣普通話發音都不標準的人,考聽力是最發愁的事了!今天上網時,看到一篇《整明白千千靜聽讓她"秀"出英語本色》的網文,觸發了靈感,花了幾個小時,寫了這個小工具,方便自己在上網之餘,跟著字幕練聽力了! 軟體準系統: 1、批量下載
Time of Update: 2018-12-05
從Delphi 5開始VCL中增加了一個新的Contnrs單元,單元中定義了8個新的類,全部都是基於標準的TList 類。 TList 類 TList 類實際上就是一個可以儲存指標的容器類,提供了一系列的方法和屬性來添加,刪除,重排,定位,存取和排序容器中的類,它是基於數組的機制來實現的容器,比較類似於C++中的Vector和Java中的ArrayList,TList
Time of Update: 2018-12-05
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP,PerlRegEx,StrUtils;type TForm1 = class(TForm)
Time of Update: 2018-12-05
原始碼:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) private { Private declarations } public { Public declarations } protected
Time of Update: 2018-12-05
Inet控制項(Internet Transfer
Time of Update: 2018-12-05
今天幫同事解決個EXCEL問題,現記在這,以作備忘現象: 想要修改保護單元 格的內容,在使用“工具”菜單“保護”子功能表的“撤消工作表保護”命令,這時要求輸入密碼。解決方案:網上找到一文http://www.excel123.cn/Article/excelvba/200812/126.html1.按Alt+F11,開啟VBA編輯器。 2.在“工程”視窗中選擇要取消保護的工作表名稱,單擊菜單“插入→模組”。 3.在右側的代碼視窗中輸入下列代碼:Sub