Delphi中用GetEnvironmentVariable擷取常用系統變數

//譬如 WINDIR 是表示系統目錄的系統變數, 可以這樣擷取:var  s: string;  begin  s := GetEnvironmentVariable('WINDIR');  ShowMessage(s); {C:\WINDOWS}end;(*--------------------------------------------------------------------------------  WINDIR            {系統目錄 - C:\WINDOWS}

用Delphi將商品金額小寫轉大寫

Function DecimalToChineseCurrency(Decimal: String): String; Var  s, t              : TStringList;  i, ti             : Integer;  tmps              : String;  IsDecimal         : Integer; Begin IsDecimal := 0;  ti := 0;  For i := 1 To Length(Decimal)

Delphi中使用TWebBrowser編輯網頁

本例效果圖:代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, OleCtrls, SHDocVw, StdCtrls, ExtCtrls;type TForm1 = class(TForm)  WebBrowser1: TWebBrowser;  Panel1: TPanel;  Button1: TButton;  C

IsLeapYear、IsInLeapYear

SysUtils.IsLeapYear();DateUtils.IsInLeapYear();unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm)  procedure FormCreate(Sender: TObject); end;var Form1: TFo

Now、Date、Time、CurrentYear

SysUtils.Now;SysUtils.Date;SysUtils.Time;SysUtils.CurrentYear;unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;type TForm1 = class(TForm)  procedure FormCreate(Sender: TObject); end;var Form1

Delphi中優秀的字串分割函數

Delphi沒有自己的字串分割函數,所以只能程式員自己寫了,網上搜了好多但是真正好用的沒有幾個。下面這個是我在網上找到修改後了的,個人感覺演算法不錯,所以就貼了上來。function SplitString(Source, Deli: string ): TStringList;stdcall;varEndOfCurrentString: byte;StringList:TStringList;beginStringList:=TStringList.Create;while Pos(Deli,

Delphi的字元及字串[6]

Delphi的字元及字串[6] - Char(AnsiChar)、WideChar與其編碼的相互轉換//Char 類型與其編碼值的轉換:var b: Byte; c: Char;begin b := Ord('A');  {返回: 65} b := Ord(#65);  {返回: 65} b := Ord($41);  {返回: 65} b := Ord(#$41); {返回: 65} b := Byte('A'); {返回: 65} b := Byte(#65); {返回: 65} b :=

Delphi的字元及字串[3]

//String 的指標地址及實際的記憶體位址varstr: string;pstr: PString;pc: PChar;begin{在沒有給 str 賦值以前, 既然聲明了, 就有了指標地址 (@str):}ShowMessage(IntToStr(Integer(@str))); {1244652; 這是在棧中的 str 的指標地址} {但現在還沒有分配真正儲存字串記憶體}ShowMessage(IntToStr(Integer(str))); {0; 0 就是 null}str := '

Delphi的字元及字串[2]

Delphi的字元及字串[2] - Char、AnsiChar、WideChar、PChar、PAnsiChar、PWideChar//單字元 Char、AnsiChar (在目前版本(2007)中, 它們是一回事, 只有 1 位元組大小)varc: Char; {Char 類型的取值範圍是: #0..#255, 用十六進位表示是: #$0..#$FF}begin{ 用十進位方式賦值:}c := #65;ShowMessage(c); {A}{用十六進位方式賦值:}c :=

Delphi的繪圖功能[6]

unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm)  Button1: TButton;  Button2: TButton;  procedure FormCreate(Sender: TObject);  procedure

Delphi語言學習8-類成員(欄位和方法)

1.Class Fields//例1 成員變數type TAncestor = class Value: Integer; end; TDescendant = class(TAncestor) Value: string; // hides the inherited Value field end;var MyObject: TAncestor;begin MyObject := TDescendant.Create; MyObject.

Delphi語言學習2-基本文法

1.基本指派陳述式Size :=20;Price :=10;2.特殊符號1)單個特殊符號# $ & ' ( ) * + , - . / : ; < = > @ [ ] ^ { }2)成對的特殊符號(* (. *) .) .. // := <= >= <>3).等價的特殊符號 特殊符號 等價的特殊符號 [ (.

Delphi語言學習1-Program和Unit

1.單元和程式(Units和Programs)1)Programsprogram Editor; uses Forms, REAbout, // An "About" box REMain; // Main form {$R *.res} begin Application.Title := 'Text Editor'; Application.CreateForm(TMainForm, MainForm);

Delphi類的入門的例子(6): 類引用樣本

unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls;type TForm1 = class(TForm)  RadioGroup1: TRadioGroup;  procedure FormMouseDown(Sender: TObject; Button:

現有Delphi項目遷移到Tiburon中的注意事項

隨著 Embarcadero 8 月 25 號發布 RAD Studio 2009 (Tiburon) 以來(Tiburon 的 RTM 日期可能要延後到 9 - 10 月),隨著 Tiburon 全面支援 Unicode,現有的 Delphi / C++ Builder 項目要遷移到 Unicode 下應該注意些什麼也成為大家最為關心的問題。Tiburon 對 Unicode 的支援不僅僅是將原來 類型映射為 AnsiString 的 String 類型直接改成 WideString,而是對

Delphi利用資料庫實現檔案打包

Delphi利用資料庫實現檔案打包的基本思路分析:【1】在Delphi中,把檔案讀取為檔案流,再以流的形式儲存在資料庫的OLE 對象的欄位中;【2】當要釋放檔案包時,可以直接讀取資料庫的OLE

delphi讀取磁碟資訊

1.讀硬碟序號function GetDiskSerial(DiskChar: Char): string;varSerialNum : pdword;a, b : dword;Buffer : array [0..255] of char;beginresult := "";if GetVolumeInformation(PChar(diskchar+":\"), Buffer, SizeOf(Buffer), SerialNum,a, b, nil,

使用Apache Lucene和Solr進行位置感知搜尋

不管是通過支援 GPS 的智能手機尋找最近的咖啡館,還是通過社交網站尋找附近的朋友,或是查看特定城市中運輸某種商品的所有貨車,越來越多的人和企業都使用位置感知的搜尋服務。建立位置感知搜尋服務通常屬於昂貴的專用解決方案的一部分,並且一般由地理空間專家完成。不過,很流行的開源搜尋庫 Apache Lucene 和強大的 Lucene 搜尋伺服器 Apache Solr

eSWT移動擴充簡介,第3部分

在行動裝置 App程式中使用進階對話方塊以及與裝置相關的特性MultiPageDialog、QueryDialog、TimedMessageBox、MobileDevice、Screen 和 Input簡介本系列的 eSWT 移動擴充簡介,第 1 部分:使用簡單小組件快速構建行動裝置 App程式 “使用簡單小組件快速構建行動裝置 App程式”

利用WebSphere Application Server for z/OS中面向目標的工作負載管理

除了在 IBM System z™ 平台之上提供一流的 J2EE™ 應用程式運行時以外,IBM® WebSphere® Application Server for z/OS® 還經過了最佳化,以利用作為當今企業 SOA 環境中的核心引擎的 System z 的獨特技術優勢。WebSphere Application Server for z/OS 的最重要獨特功能之一是面向目標的工作負載管理功能。引言運行在 z/OS 上的 J2EE

總頁數: 61357 1 .... 27144 27145 27146 27147 27148 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.