Git Product home page Git Product logo

delphi's People

Watchers

James Cloos avatar

delphi's Issues

delphi安装 Tclientsocket, Tserversocket控件

delphi安装 Tclientsocket, Tserversocket控件
添加方法:
菜单component->Install Packets
按Add按钮,选择delphi目录里的bin目录下的dclsockets70.bpl(delphi2010是dclsockets140.bpl),然后TClientSocket和TServerSocket控件就会出现在Internet页上了。

TSearchRec-寻找目标目录下的文件

FindFirst是用来寻找目标目录下的第一个文件,FindNext则是寻找下一个
TSearchRec是一个文件信息的纪录,当FindFirst返回SearchRec时,你可以通过SearchRec.Name获取文件名,以及SearchRec.Size获取文件大小等信息。
TSearchRec类型定义如下:
type
TSearchRec = record
Time : Integer;
Size : Integer;
Attr : Integer;
Name : TFileName;
ExcludeAttr : Integer;
FindHandle : THandle;
FindData : TWin32FindData;
end;

 当利用FindFirst和FindNext函数找到一个文件后,利用这个类型可以获得文件的属性、大小和修改时间等信息。

var
SearchRec:TSearchRec; //搜索对象
ext,AppPath:string;
begin
listbox1.Clear; //清空列表框
AppPath:=edit1.text; //设置要搜索的目标目录
ext:='.'; //设置要搜索的文件后缀名
FindFirst(AppPath+ext,faAnyFile,SearchRec); //-faDirectory
listbox1.Items.Add(SearchRec.Name); //添加文件名称
while FindNext(SearchRec)=0 do
listbox1.Items.Add(SearchRec.Name); //添加文件名
end;

//更多注释:
//TSearchRec 结构是内涵文件大小、名称、属性与时间等信息
//TSearchRec 中的属性是一个整数值, 可能的值有:
//faReadOnly 1 只读文件
//faHidden 2 隐藏文件
//faSysFile 4 系统文件
//faVolumeID 8 卷标文件
//faDirectory 16 目录文件
//faArchive 32 归档文件
//faSymLink 64 链接文件
//faAnyFile 63 任意文件
//s 的值也可以使用?通配符,好像只支持7个?, 如果没有条件就是*, 譬如: C:*
//实际使用中还应该在 repeat 中提些条件, 譬如判断如果是文件夹就递归搜索等等

function FindFirst(const Path: string; //包含路径和通配符的字符串,如f:\test\*.* Attr: Integer; //文件属性 var F: TSearchRec //一个结构(或叫记录) ): Integer; //返回值,成功返回0 ,失败返回-1

卓创历史价格建表

-- =============================================
-- 建个表,用于存储卓创公布的数据,以乙二醇为例
-- =============================================
IF EXISTS(SELECT NAME
FROM SYSOBJECTS
WHERE NAME = ‘UPDATA'
AND TYPE = 'U')
DROP TABLE UPDATA
GO

CREATE TABLE UPDATA
(
DD DATETIME,
PRD VARCHAR(200),
UPMIN FLOAT,
UPMAX FLOAT,
UPAVG FLOAT,
UT VARCHAR(20),
SPC VARCHAR(200),
CUS VARCHAR(200),
MARKET VARCHAR(200),
AREA VARCHAR(200),
PROV VARCHAR(200),
CITY VARCHAR(200),
UPCON VARCHAR(200),
REM VARCHAR(200),
UPLS FLOAT,
UPPF FLOAT
)

GO

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.