Files
playbook/docs/tsl/codegen/builtin/language/object_tsl.md
T

2185 lines
63 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Object TSL 方法补录
这些条目来自旧 Object TSL 文档。标题保留方法名,正文记录所属对象。
## `TSLObjects(_type)`
获取当前运行环境下所有对象的信息。 目前仅下一代服务器与两个客户端本地解析器中支持。
旧定义:`TSLObjects(Type:Boolean):array`
来源:TSL语言基础 > Object TSL > 函数信息
Source ID33022
| 参数 | 类型 | 说明 |
| ------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `_type` | Boolean | 是否获取原对象。当Type为False,仅获取对象的引用计数;当Type为True时,除了会获取对象的引用计数外,还会获取对象本身。 注:不支持获取二进制对象信息,如天软内置对象TstringList、ThashedStringList等。 |
返回:Array,TableArray,数组,对象信息集合。每一行都是同类对象的信息集合,行下标即为该对象类名,其中每一单元格格式如下: 表格:行标 / 说明 / 备注;refs / 整数类型,对象的直接引用计数 / 只新一代语言中有该返回;orefs / 整数类型,对象的间接引用计数;obj / 对象类型,原对象 / 当Type为True时,返回值中才有该字段 注:只有当对象的直接引用和间接引用都为0时,该对象才会被销毁。 直接引用:允许直接使用对象的引用访问属性和方法,不需要额外的引用变量。 间接引用:将对象的引用通过某种方式(如findFunction等)赋值给其他引用变量,再通过该引用变量访问其属性或方法。
## `FindOverLoad(p_n, function_name, obj)`
查找对象中的方法,支持查找重载方法。
旧定义:`FindOverLoad(pN:Integer;FunctionName:String;Obj:Object or Class)`
来源:TSL语言基础 > Object TSL > 函数信息
Source ID29867
| 参数 | 类型 | 说明 |
| --------------- | --------------- | -------------------------------------------------------------------------------------- |
| `p_n` | Integer | 整数,方法的参数个数。 |
| `function_name` | String | 字符串,查找的方法名 |
| `obj` | Object or Class | 实例对象或类,当为类时,格式为:Class(类名),这种方法只能差找类方法,不能查找实例方法。 |
返回:any,方法的指针
## `SetCustomHeader(name, value)`
设置header字段。
对象:TWebResponse
旧定义:`SetCustomHeader(Name;Value:String);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebResponse对象 > TWebResponse的方法
Source ID1647
| 参数 | 类型 | 说明 |
| ------- | ------ | ---------------- |
| `name` | String | Header里的键名。 |
| `value` | String | Header里的值。 |
返回:any
## `SetCookieField(values, domain, path, expires, secure)`
设置Cookie字段。
对象:TWebResponse
旧定义:`SetCookieField(Values:TStrings;domain;path:String;expires:TDateTime;secure:Boolean);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebResponse对象 > TWebResponse的方法
Source ID1646
| 参数 | 类型 | 说明 |
| --------- | --------- | ---------------------------------------------------------- |
| `values` | TStrings | TStrings类型,Cookie的内容,可为多个。 |
| `domain` | String | 字符串类型,Cookie的有效域。 |
| `path` | String | 字符串类型,有效Path |
| `expires` | TDateTime | 时间类型,过期时间。 |
| `secure` | Boolean | Boolean类型,是否安全Cookie,如果是则仅当HTTPS链接被支持。 |
返回:any
## `Sent()`
是否已发送。已经发送则设置头信息没有意义。
对象:TWebResponse
旧定义:`Sent():Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebResponse对象 > TWebResponse的方法
Source ID1645
返回:Boolean,如果已经发送则为真,否则为假
## `SendStream(stream)`
发送流。
对象:TWebResponse
旧定义:`SendStream(Stream:TStream);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebResponse对象 > TWebResponse的方法
Source ID1644
| 参数 | 类型 | 说明 |
| -------- | ------- | -------------- |
| `stream` | TStream | 要发送的内容。 |
返回:any
## `SendResponse()`
发送响应包。
对象:TWebResponse
旧定义:`SendResponse();`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebResponse对象 > TWebResponse的方法
Source ID1643
返回:any
## `SendRedirect(uri)`
发送重定向。
对象:TWebResponse
旧定义:`SendRedirect(URI:String);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebResponse对象 > TWebResponse的方法
Source ID1642
| 参数 | 类型 | 说明 |
| ----- | ------ | -------------- |
| `uri` | String | 重定向的路径。 |
返回:any
## `GetCustomHeader(name)`
读取CustomHeaders里的内容。
对象:TWebResponse
旧定义:`GetCustomHeader(Name:String):String;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebResponse对象 > TWebResponse的方法
Source ID1641
| 参数 | 类型 | 说明 |
| ------ | ------ | ------------ |
| `name` | String | 要取的名字。 |
返回:String,头部里的值。
## `TranslateURI(uri)`
将一个URI转换成服务器上可用的路径格式。
对象:TWebRequest
旧定义:`TranslateURI(URI:String):String;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebRequest对象 > TWebRequest的方法
Source ID1696
| 参数 | 类型 | 说明 |
| ----- | ------ | ------------ |
| `uri` | String | 要转换的串。 |
返回:String,服务器上所支持的串格式。
## `GetFieldByName(name)`
取Header的值。
对象:TWebRequest
旧定义:`GetFieldByName(Name:String):String;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebRequest对象 > TWebRequest的方法
Source ID1695
| 参数 | 类型 | 说明 |
| ------ | ------ | ------------------ |
| `name` | String | 要取的内容的名字。 |
返回:String,取值的结果。
## `ExtractQueryFields(strings)`
将Query的内容展开到列表里。
对象:TWebRequest
旧定义:`ExtractQueryFields(Strings:TStrings);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebRequest对象 > TWebRequest的方法
Source ID1694
| 参数 | 类型 | 说明 |
| --------- | -------- | -------------------------------------------------------------- |
| `strings` | TStrings | TStrings类型,用来存贮展开的内容,假定Query的内容是以&分割的。 |
返回:any
## `ExtractCookieFields(strings)`
将Cookie的内容展开到列表里。
对象:TWebRequest
旧定义:`ExtractCookieFields(Strings:TStrings);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebRequest对象 > TWebRequest的方法
Source ID1693
| 参数 | 类型 | 说明 |
| --------- | -------- | --------------------------------------------------------------- |
| `strings` | TStrings | TStrings类型,用来存贮展开的内容,假定Cookie的内容是以;分割的。 |
返回:any
## `ExtractContentFields(strings)`
将post的内容展开到列表里。
对象:TWebRequest
旧定义:`ExtractContentFields(Strings:TStrings);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebRequest对象 > TWebRequest的方法
Source ID1692
| 参数 | 类型 | 说明 |
| --------- | -------- | ------------------------------------------------------------- |
| `strings` | TStrings | TStrings类型,用来存贮展开的内容,假定发送的内容是以&分割的。 |
返回:any
## `WriteHeaders(status_code, headers)`
向客户端发送头部。
对象:TWebRequest
旧定义:`WriteHeaders(StatusCode:Integer; ResonString;Headers:String):Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebRequest对象 > TWebRequest的方法
Source ID1691
| 参数 | 类型 | 说明 |
| ------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| `status_code` | Integer | 整数类型,状态码,如200为正确。 ReasonString:字符串类型,理由串,例如返回了一个错误,需要有个显示的理由。 |
| `headers` | String | 字符串类型,头部信息串。 |
返回:Boolean,是否写入成功。
## `WriteString(s)`
向客户端发送的数据。
对象:TWebRequest
旧定义:`WriteString(S:String/Binary):Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebRequest对象 > TWebRequest的方法
Source ID1690
| 参数 | 类型 | 说明 |
| ---- | ------------- | ---------------------- |
| `s` | String/Binary | 字符串,要发送的内容。 |
返回:Boolean,是否写入成功。
## `ReadString(count)`
读取客户端发送的数据。
对象:TWebRequest
旧定义:`ReadString(Count:Integer):String;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebRequest对象 > TWebRequest的方法
Source ID1689
| 参数 | 类型 | 说明 |
| ------- | ------- | ---------------------- |
| `count` | Integer | 整数类型,读取的长度。 |
返回:String,实际读出的内容。
## `WriteClient(buffer, count)`
向客户端发送的数据。
对象:TWebRequest
旧定义:`WriteClient(Buffer:String/Binary;Count:Integer):Integer;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebRequest对象 > TWebRequest的方法
Source ID1688
| 参数 | 类型 | 说明 |
| -------- | ------------- | -------------------------------------------- |
| `buffer` | String/Binary | 字符串或者二进制流,要发送的内容。 |
| `count` | Integer | 整数类型,写入的长度,不可超过Buffer的长度。 |
返回:Integer,实际写入的字节数。
## `ReadClient(buffer, count)`
读取客户端发送的数据。
对象:TWebRequest
旧定义:`ReadClient(Var Buffer:String/Binary;Count:Integer):Integer;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TWebRequest对象 > TWebRequest的方法
Source ID1687
| 参数 | 类型 | 说明 |
| -------- | ------------- | -------------------------------------------- |
| `buffer` | String/Binary | 字符串或者二进制流,用来存贮读出的内容。 |
| `count` | Integer | 整数类型,读取的长度,不可超过Buffer的长度。 |
返回:Integer,实际读出的字节数。
## `ExChange(index1, index2)`
将两个位置的内容互相交换。
对象:TStringList
旧定义:`ExChange(Index1;Index2:Integer);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TStringList对象 > TStringList的方法
Source ID31667
| 参数 | 类型 | 说明 |
| -------- | ------- | ----------------------- |
| `index1` | Integer | 整数类型,互换的位置1。 |
| `index2` | Integer | 整数类型,互换的位置2。 |
返回:any
## `SetText(text)`
设置text的内容,与设置属性Text的操作相同。
对象:TStringList
旧定义:`SetText(Text:String);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TStringList对象 > TStringList的方法
Source ID1556
| 参数 | 类型 | 说明 |
| ------ | ------ | ------------------------ |
| `text` | String | 字符串类型,设置的内容。 |
返回:any
## `OnlineSession(id, strings)`
获得指定用户的在线会话列表,一般用于调试用。
对象:TSessionMan
旧定义:`OnlineSession(Id:String;Strings:TStrings);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TSessionMan对象 > TSessionMan的方法
Source ID1724
| 参数 | 类型 | 说明 |
| --------- | -------- | ---------------------------------------------------------------- |
| `id` | String | 字符串类型,用来进行唯一标示的串。开发中,大多情况下使用用户名。 |
| `strings` | TStrings | TStrings类型,用来存贮用户(ID)列表。 |
返回:any
## `OnlineUser(strings)`
获得在线的ID列表。
对象:TSessionMan
旧定义:`OnlineUser(Strings:TStrings);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TSessionMan对象 > TSessionMan的方法
Source ID1723
| 参数 | 类型 | 说明 |
| --------- | -------- | -------------------------------------- |
| `strings` | TStrings | TStrings类型,用来存贮用户(ID)列表。 |
返回:any
## `Move(cur_index, new_index)`
将指定位置的内容移动到新位置。
对象:TStringList
旧定义:`Move(CurIndex;NewIndex:Integer);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TStringList对象 > TStringList的方法
Source ID1553
| 参数 | 类型 | 说明 |
| ----------- | ------- | ------------------------------------ |
| `cur_index` | Integer | 整数类型,需要移动的内容的原始位置。 |
| `new_index` | Integer | 整数类型,移动到的新位置索引。 |
返回:any
## `DeleteSession(id, session_id)`
删除会话。
对象:TSessionMan
旧定义:`DeleteSession(Id:String;[SessionId:String]);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TSessionMan对象 > TSessionMan的方法
Source ID1722
| 参数 | 类型 | 说明 |
| ------------ | ------ | --------------------------------------------------------------------- |
| `id` | String | 字符串类型,用来进行唯一标示的串。开发中,大多情况下使用用户名。 |
| `session_id` | String | 字符串类型,可省略,会话标识,如果会话ID不设置,则可为任何SessionId。 |
返回:any
## `AssignTo(des)`
复制Cookie的内容到Des。
对象:TCookie
旧定义:`AssignTo(Des:TCookie);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TCookie对象 > TCookie的方法
Source ID1716
| 参数 | 类型 | 说明 |
| ----- | ------- | ---- |
| `des` | TCookie | |
返回:any
## `GetSession(id, session_id)`
获得一个已有的会话。
对象:TSessionMan
旧定义:`GetSession(Id:String;[SessionId:String]):TSession;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TSessionMan对象 > TSessionMan的方法
Source ID1721
| 参数 | 类型 | 说明 |
| ------------ | ------ | --------------------------------------------------------------------- |
| `id` | String | 字符串类型,用来进行唯一标示的串。开发中,大多情况下使用用户名。 |
| `session_id` | String | 字符串类型,可省略,会话标识,如果会话ID不设置,则可为任何SessionId。 |
返回:TSession,如果获得成功则返回一个会话对象,否则返回0。
## `AppendMessage(folder_name, msg)`
添加邮件至指定文件夹
对象:IMAP
旧定义:`AppendMessage(FolderName:String,Msg:MailMsg):Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > IMAP对象 > IMAP对象的方法
Source ID37947
| 参数 | 类型 | 说明 |
| ------------- | ------ | ------------------------- |
| `folder_name` | String | 目标文件夹名称 |
| `msg` | String | 参考ID 1786,邮件消息对象 |
返回:Boolean,添加成功,返回True;否则返回False
## `HeaderValue()`
获得Cookie在Header里的串。
对象:TCookie
旧定义:`HeaderValue():String;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TCookie对象 > TCookie的方法
Source ID1714
返回:String,返回组成串。
## `CopyMessage(folder_name, msg_id, dest_folder_name)`
复制邮件至目标文件夹
对象:IMAP
旧定义:`CopyMessage(FolderName:String,MsgID:Integet,DestFolderName:String):Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > IMAP对象 > IMAP对象的方法
Source ID37946
| 参数 | 类型 | 说明 |
| ------------------ | ------- | -------------- |
| `folder_name` | String | 源文件夹名称 |
| `msg_id` | integer | 邮件编号 |
| `dest_folder_name` | String | 目标文件夹名称 |
返回:Boolean,复制成功,返回True;否则返回False
## `IndexOfName(name)`
返回Name键值所在的索引号。
对象:TStringList
旧定义:`IndexOfName(Name:String):Integer;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TStringList对象 > TStringList的方法
Source ID1550
| 参数 | 类型 | 说明 |
| ------ | ------ | -------------------------------------------------- |
| `name` | String | 字符串类型,查找的Name=Value中的Name所在的索引号。 |
返回:Integer,如果查找到则返回所在的索引号,如果未找到则返回-1。
## `NewSession(id, max_session)`
新建一个会话。
对象:TSessionMan
旧定义:`NewSession(Id:String[;MaxSession:Integer]):TSession;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TSessionMan对象 > TSessionMan的方法
Source ID1720
| 参数 | 类型 | 说明 |
| ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------ |
| `id` | String | 字符串类型,用来进行唯一标示的串。开发中,大多情况下使用用户名。 |
| `max_session` | Integer | 整数类型,可省略,指定的Id最多允许的会话个数。开发中,大多数情况下采用允许的登录次数。如果省略,则表示不限制会话的个数。 |
返回:TSession,如果新建成功则返回一个会话对象,否则返回0。
## `RetrieveMailBoxSize(folder_name)`
对象:IMAP
旧定义:`RetrieveMailBoxSize([FolderName:String]):Integer;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > IMAP对象 > IMAP对象的方法
Source ID37945
| 参数 | 类型 | 说明 |
| ------------- | ------ | ---- |
| `folder_name` | String | |
返回:Integer
## `GetText()`
与Text属性的结果相同。
对象:TStringList
旧定义:`GetText:String;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TStringList对象 > TStringList的方法
Source ID1549
返回:any
## `CheckMessages(folder_name)`
查看邮箱文件夹邮件数量
对象:IMAP
旧定义:`CheckMessages([FolderName:String]):Integer;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > IMAP对象 > IMAP对象的方法
Source ID37943
| 参数 | 类型 | 说明 |
| ------------- | ------ | -------------------------------------------------------------- |
| `folder_name` | String | 可选参数,邮箱文件夹名称;若未指定,默认获取收件箱中的邮件数量 |
返回:integer,文件夹中的邮件数量
## `CAPA()`
获取服务器的支持命令列表。
对象:IMAP
旧定义:`CAPA():String;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > IMAP对象 > IMAP对象的方法
Source ID37938
返回:String
## `Equals(src)`
比较两个内容是否相同。
对象:TStringList
旧定义:`Equals(src:TStrings);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TStringList对象 > TStringList的方法
Source ID1548
| 参数 | 类型 | 说明 |
| ----- | -------- | ------------------------------------------------- |
| `src` | TStrings | TStringList或者其他TStrings派生类型,比较的对象。 |
返回:any
## `RenameFolder(folder_name, new_folder_name)`
重命名邮箱文件夹
对象:IMAP
旧定义:`RenameFolder(FolderName,NewFolderName:String):Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > IMAP对象 > IMAP对象的方法
Source ID37942
| 参数 | 类型 | 说明 |
| ----------------- | ------ | ---------------- |
| `folder_name` | String | 原邮箱文件夹名称 |
| `new_folder_name` | String | 新邮箱文件夹名称 |
返回:Boolean,重命名成功,返回True;否则返回False
## `KeepAlive()`
发送空指令保持服务的连接。
对象:IMAP
旧定义:`KeepAlive();`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > IMAP对象 > IMAP对象的方法
Source ID37937
返回:any
## `DeleteFolder(folder_name)`
删除指定邮件文件夹
对象:IMAP
旧定义:`DeleteFolder(FolderName:String):Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > IMAP对象 > IMAP对象的方法
Source ID37941
| 参数 | 类型 | 说明 |
| ------------- | ------ | ---------------------- |
| `folder_name` | String | 要删除的邮箱文件夹名称 |
返回:Boolean,删除成功,返回True;否则返回False
## `Logout()`
退出登录
对象:IMAP
旧定义:`Logout();`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > IMAP对象 > IMAP对象的方法
Source ID37936
返回:any
## `Login()`
登录,调用前必须先设置Host、Port、Username、Password属性
对象:IMAP
旧定义:`Login();`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > IMAP对象 > IMAP对象的方法
Source ID37935
返回:any
## `CreateFolder(folder_name)`
新建邮箱文件夹
对象:IMAP
旧定义:`CreateFolder(FolderName:String):Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > IMAP对象 > IMAP对象的方法
Source ID37940
| 参数 | 类型 | 说明 |
| ------------- | ------ | ---------- |
| `folder_name` | String | 文件夹名称 |
返回:Boolean,新建成功,返回True;否则返回False
## `Login()`
登录,此前必须制定Username和Password属性。
对象:Pop3
旧定义:`Login()`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > Pop3对象 > Pop3对象的方法
Source ID29871
返回:any
## `ListFolders(reference, mail_box)`
获取邮箱文件夹的列表信息
对象:IMAP
旧定义:`ListFolders([Reference[,MailBox]:String]):Array;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > IMAP对象 > IMAP对象的方法
Source ID37939
| 参数 | 类型 | 说明 |
| ----------- | ------ | -------------------------------------------------- |
| `reference` | String | 查询参考,即邮箱前缀,如"mybox/"、"mybox"等 |
| `mail_box` | String | 邮箱名称,可带*或%通配符,如"*"、"sub*"等,默认"*" |
返回:Array,二维数组,邮箱文件夹列表信息;其中,列名含义如下: 表格:列名 / 说明;attributes / 文件夹属性标志列表;hierarchy_delimiter / 层级分隔符;name / 文件夹完整名称,包含所有父级路径
## `AddStrings(strings)`
将Strings里的字符串批量添加。
对象:TStringList
旧定义:`AddStrings(Strings:TStrings);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TStringList对象 > TStringList的方法
Source ID1545
| 参数 | 类型 | 说明 |
| --------- | -------- | ------------------------------------- |
| `strings` | TStrings | TStringList或者其他TStrings派生类型。 |
返回:any
## `CAPA()`
取服务器的支持命令列表。
对象:Pop3
旧定义:`CAPA():String;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > Pop3对象 > Pop3对象的方法
Source ID1772
返回:String
## `Reset()`
复位,撤销所有本次会话中的删除操作。
对象:Pop3
旧定义:`Reset():Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > Pop3对象 > Pop3对象的方法
Source ID1763
返回:Boolean
## `UIDL(ids)`
取服务器的邮件唯一标示列表。
对象:Pop3
旧定义:`UIDL(Var IDS:String):Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > Pop3对象 > Pop3对象的方法
Source ID1771
| 参数 | 类型 | 说明 |
| ----- | ------ | ---------------------------- |
| `ids` | String | 字符串,存放获取到的标示列表 |
返回:Boolean,返回1则获取成功,0则失败。
## `KeepAlive()`
发送空指令保持服务的连接。
对象:Pop3
旧定义:`KeepAlive();`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > Pop3对象 > Pop3对象的方法
Source ID1762
返回:any
## `RetrieveRaw(msg_id, msg_content)`
取邮件的原始内容。
对象:Pop3
旧定义:`RetrieveRaw(MsgId:Integer;Var MsgContent:String):Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > Pop3对象 > Pop3对象的方法
Source ID1770
| 参数 | 类型 | 说明 |
| ------------- | ------- | ---------------------------- |
| `msg_id` | integer | 邮件ID |
| `msg_content` | String | 获取成功时返回的原始邮件内容 |
返回:Boolean,获取邮件原始内容是否成功
## `RetrieveHeader(msg_id, msg)`
取邮件的内容,仅仅取邮件的头部信息,不取附件等内容。
对象:Pop3
旧定义:`RetrieveHeader(MsgId:Integer;Var Msg:MailMsg):Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > Pop3对象 > Pop3对象的方法
Source ID1769
| 参数 | 类型 | 说明 |
| -------- | ------- | ------------------------------------------------------- |
| `msg_id` | integer | 邮件ID |
| `msg` | TSLObj | 获取成功时返回的邮件头部信息,具体类型可参考FAQ ID 1786 |
返回:Boolean,获取邮件头部信息是否成功
## `IndexOf(s)`
返回字符串所在的索引号。查找与大小写敏感设置有关。
对象:TStringList
旧定义:`IndexOf(S:String):Integer;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TStringList对象 > TStringList的方法
Source ID1542
| 参数 | 类型 | 说明 |
| ---- | ------ | -------------------------- |
| `s` | String | 字符串类型,查找的字符串。 |
返回:Integer,如果查找到则返回所在的索引号,重复值查找返回第一个查找到的索引号,如果未找到则返回-1。
## `CheckMessages()`
返回邮件的个数。
对象:Pop3
旧定义:`CheckMessages():Integer;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > Pop3对象 > Pop3对象的方法
Source ID1761
返回:Integer
## `Retrieve(msg_id, msg)`
取邮件的内容。
对象:Pop3
旧定义:`Retrieve(MsgId:Integer;Var Msg:MailMsg):Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > Pop3对象 > Pop3对象的方法
Source ID1768
| 参数 | 类型 | 说明 |
| -------- | ------- | --------------------------------------------------- |
| `msg_id` | integer | 邮件ID |
| `msg` | TSLObj | 获取成功时返回的邮件内容,具体类型可参考FAQ ID 1786 |
返回:Boolean,获取邮件内容是否成功
## `DisconnectNotifyPeer()`
断开并且通知服务器。
对象:Pop3
旧定义:`DisconnectNotifyPeer()`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > Pop3对象 > Pop3对象的方法
Source ID1760
返回:any
## `RetrieveMailBoxSize()`
获取邮箱的大小。
对象:Pop3
旧定义:`RetrieveMailBoxSize():Integer;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > Pop3对象 > Pop3对象的方法
Source ID1767
返回:Integer
## `RetrieveMsgSize(msg_id)`
取指定邮件的大小。
对象:Pop3
旧定义:`RetrieveMsgSize(MsgId:Integer):Integer;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > Pop3对象 > Pop3对象的方法
Source ID1766
| 参数 | 类型 | 说明 |
| -------- | ------- | ------------ |
| `msg_id` | integer | 指定邮件序号 |
返回:integer,邮件大小,单位:字节
## `SendCmd(cmd, cmd_result, ret_code)`
发送命令。
对象:Pop3
旧定义:`SendCmd(Cmd:String;[Var CmdResult:String;Var RetCode:String]):Integer;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > Pop3对象 > Pop3对象的方法
Source ID1757
| 参数 | 类型 | 说明 |
| ------------ | ------ | ------------------------ |
| `cmd` | String | 字符串类型,发送的命令。 |
| `cmd_result` | String | 可选参数,返回的结果串。 |
| `ret_code` | String | 可选参数,返回的代码串。 |
返回:Integer,0表示执行成功,其它则表示失败或出现错误。
## `SetStrings(strings)`
设置所有内容。
对象:TMemIniFile
旧定义:`SetStrings(Strings: TStrings);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TMemIniFile对象 > TMemIniFile的方法
Source ID1610
| 参数 | 类型 | 说明 |
| --------- | -------- | -------------------------------------------- |
| `strings` | TStrings | TStringList类型,用于设置TMemIniFile的内容。 |
返回:any
## `PriDecrypt(s)`
对字符串s的内容用私钥解密,
对象:TRSA
旧定义:`PriDecrypt(s:string):string;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TRSA > TRSA的方法
Source ID29956
| 参数 | 类型 | 说明 |
| ---- | ------ | ---- |
| `s` | string | |
返回:string
## `GetStrings(strings)`
取出所有内容。
对象:TMemIniFile
旧定义:`GetStrings(Strings: TStrings);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TMemIniFile对象 > TMemIniFile的方法
Source ID1609
| 参数 | 类型 | 说明 |
| --------- | -------- | -------------------------------------------- |
| `strings` | TStrings | TStringList类型,用于存贮TMemIniFile的内容。 |
返回:any
## `PubDecrypt(s)`
对字符串s的内容用公钥解密,
对象:TRSA
旧定义:`PubDecrypt(s:string):string;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TRSA > TRSA的方法
Source ID29955
| 参数 | 类型 | 说明 |
| ---- | ------ | ---- |
| `s` | string | |
返回:string
## `PriEncrypt(s)`
对字符串s的内容用私钥加密,
对象:TRSA
旧定义:`PriEncrypt(s:string):string;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TRSA > TRSA的方法
Source ID29954
| 参数 | 类型 | 说明 |
| ---- | ------ | ---- |
| `s` | string | |
返回:string
## `DecryptFile(src_alias, src_filename, dest_alias, dest_filename)`
对文件src_filename进行解密,加密后的内容写入dest_filename文件中。
对象:TCipher
旧定义:`DecryptFile(src_alias:string; src_filename:string; dest_alias:string; dest_filename:string);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TCipher > TCipher类的方法
Source ID29970
| 参数 | 类型 | 说明 |
| --------------- | ------ | ---- |
| `src_alias` | string | |
| `src_filename` | string | |
| `dest_alias` | string | |
| `dest_filename` | string | |
返回:any
## `Login()`
登录,暂不支持。但是,在设置了Username和Password属性时,使用connect()方法就包括连接服务器和登陆功能。如需验证用户名密码可使用Authenticate()方法。
对象:SMTP
旧定义:`Login()`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > SMTP对象 > SMTP对象的方法
Source ID29870
返回:any
## `PubEncrypt(s)`
对字符串s的内容用公钥加密,
对象:TRSA
旧定义:`PubEncrypt(s:string):string;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TRSA > TRSA的方法
Source ID29953
| 参数 | 类型 | 说明 |
| ---- | ------ | ---- |
| `s` | string | |
返回:string
## `Decrypt(s)`
字符串s的内容解密,返回解密后的字符串
对象:TCipher
旧定义:`Decrypt(s:string):string;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TCipher > TCipher类的方法
Source ID29969
| 参数 | 类型 | 说明 |
| ---- | ------ | ---- |
| `s` | string | |
返回:string
## `GenerateKey()`
生成指定位数的公钥和私钥,位数必须是256的正整数倍,最大4096
对象:TRSA
旧定义:`procedure GenerateKey(bits:int);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TRSA > TRSA的方法
Source ID29952
返回:any
## `Expand(username)`
展开用户名,例如用于邮件列表。需要服务器配置,暂不支持。
对象:SMTP
旧定义:`Expand (Username : String):String;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > SMTP对象 > SMTP对象的方法
Source ID1742
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------------------------- |
| `username` | String | 字符串类型,展开的用户名。 |
返回:String,展开后的用户名。
## `EncryptFile(src_alias, src_filename, dest_alias, dest_filename)`
对文件src_filename进行加密,加密后的内容写入dest_filename文件中。
对象:TCipher
旧定义:`EncryptFile(src_alias:string; src_filename:string; dest_alias:string; dest_filename:string);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TCipher > TCipher类的方法
Source ID29968
| 参数 | 类型 | 说明 |
| --------------- | ------ | ---- |
| `src_alias` | string | |
| `src_filename` | string | |
| `dest_alias` | string | |
| `dest_filename` | string | |
返回:any
## `QuickSend(a_host, a_subject, a_to, a_from, a_text)`
发送邮件。暂时不支持
对象:SMTP
旧定义:`QuickSend (AHost; ASubject; ATo; AFrom; AText : String);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > SMTP对象 > SMTP对象的方法
Source ID1741
| 参数 | 类型 | 说明 |
| ----------- | ------ | ---------------------------------- |
| `a_host` | String | 字符串类型,服务器主机名或者地址。 |
| `a_subject` | String | 字符串类型,标题。 |
| `a_to` | String | 接受者邮件地址。 |
| `a_from` | String | 来源邮件地址。 |
| `a_text` | String | 发送的邮件的内容。 |
返回:any
## `Encrypt(s)`
对字符串s的内容加密,返回加密后的字符串
对象:TCipher
旧定义:`Encrypt(s:string):string;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TCipher > TCipher类的方法
Source ID29967
| 参数 | 类型 | 说明 |
| ---- | ------ | ---- |
| `s` | string | |
返回:string
## `Authenticate()`
服务器验证。验证用户名和密码是否能登陆smtp服务器。使用之前需要先使用connect()方法。
对象:SMTP
旧定义:`Authenticate:Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > SMTP对象 > SMTP对象的方法
Source ID1740
返回:any
## `Send(message)`
发送邮件。
对象:SMTP
旧定义:`Send (Message:MailMsg);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > SMTP对象 > SMTP对象的方法
Source ID1739
| 参数 | 类型 | 说明 |
| --------- | ------- | --------------------------------- |
| `message` | MailMsg | MailMsg对象,需要发送的邮件内容。 |
返回:any
## `DisconnectNotifyPeer()`
断开并且通知服务器。
对象:SMTP
旧定义:`DisconnectNotifyPeer()`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > SMTP对象 > SMTP对象的方法
Source ID1738
返回:any
## `SendCmd(cmd, cmd_result, ret_code)`
发送命令。
对象:SMTP
旧定义:`SendCmd(Cmd:String;[Var CmdResult:String;Var RetCode:String]):Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > SMTP对象 > SMTP对象的方法
Source ID1735
| 参数 | 类型 | 说明 |
| ------------ | ------ | ------------------------ |
| `cmd` | String | 字符串类型,发送的命令。 |
| `cmd_result` | String | 可选参数,返回的结果串。 |
| `ret_code` | String | 可选参数,返回的代码串。 |
返回:Boolean
## `ValueExists(section, ident)`
是否存在指定的键。
对象:TIniFile
旧定义:`ValueExists(Section;Ident:String):Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1604
| 参数 | 类型 | 说明 |
| --------- | ------ | ---------------------------------- |
| `section` | String | 字符串类型,要查找的键所在章节名。 |
| `ident` | String | 字符串类型,要查找的键名。 |
返回:Boolean,Boolean类型,如果找到则为真,否则为假。
## `SetSize(size)`
设置大小。私有方法,实例与继承类无法访问。改变大小可通过属性Size进行赋值设置。
对象:TStream
旧定义:`SetSize(Size:Integer);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TStream对象 > TStream的方法
Source ID1567
| 参数 | 类型 | 说明 |
| ------ | ------- | ---------------------------- |
| `size` | Integer | 整数类型。要设置的新的大小。 |
返回:any
## `ReadDate(section, ident, default)`
读INI内容。
对象:TIniFile
旧定义:`ReadInteger(Section;Ident:String;Default: TDate): TDate;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1593
| 参数 | 类型 | 说明 |
| --------- | ------ | ---------------------------------- |
| `section` | String | 字符串类型,节名。 |
| `ident` | String | 字符串类型,键值名。 |
| `default` | TDate | 日期类型,当不存在的时候的默认值。 |
返回:TDate,读取的结果。
## `DeleteKey(section, ident)`
删除指定的键。
对象:TIniFile
旧定义:`DeleteKey(Section;Ident:String);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1603
| 参数 | 类型 | 说明 |
| --------- | ------ | ---------------------------------- |
| `section` | String | 字符串类型,要删除的键所在章节名。 |
| `ident` | String | 字符串类型,要删除的键名。 |
返回:any
## `CopyFrom(src, count)`
复制流,复制成功后当前位置会移动Count个位置。
对象:TStream
旧定义:`CopyFrom(Src:TStream;Count:Integer):Integer;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TStream对象 > TStream的方法
Source ID1564
| 参数 | 类型 | 说明 |
| ------- | ------- | ---------------------- |
| `src` | TStream | 流类型,复制的来源。 |
| `count` | Integer | 整数类型,复制的个数。 |
返回:Integer,返回复制的个数。
## `Seek(position, origin)`
移动指针。
对象:TStream
旧定义:`Seek(Position:Integer;[Origin:Integer]):Integer;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TStream对象 > TStream的方法
Source ID1566
| 参数 | 类型 | 说明 |
| ---------- | ------- | ---------------------------------------------------------------------------------------------------- |
| `position` | Integer | 整数,移动的位置。 |
| `origin` | Integer | 整数类型,可选参数,移动的方法。0:从头开始移,1:从当前位置,2:从尾部。省略参数的默认值为从头开始移。 |
返回:Integer,移动后的位置。
## `WriteBinaryStream(section, ident, value)`
写INI内容。
对象:TIniFile
旧定义:`WriteBinaryStream(Section;Ident:String;Value: TStream);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1592
| 参数 | 类型 | 说明 |
| --------- | ------- | --------------------- |
| `section` | String | 字符串类型,节名。 |
| `ident` | String | 字符串类型,键值名。 |
| `value` | TStream | TStream类型,值内容。 |
返回:any
## `EraseSection(section)`
删除章节。
对象:TIniFile
旧定义:`EraseSection(Section:String);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1602
| 参数 | 类型 | 说明 |
| --------- | ------ | ---------------------------- |
| `section` | String | 字符串类型,要删除的章节名。 |
返回:any
## `ReadBinaryStream(section, ident, value)`
读INI内容。
对象:TIniFile
旧定义:`ReadBinaryStream(Section;Ident:String;Value:TStream): Integer;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1591
| 参数 | 类型 | 说明 |
| --------- | ------- | ----------------------------- |
| `section` | String | 字符串类型,节名。 |
| `ident` | String | 字符串类型,键值名。 |
| `value` | TStream | TStream类型,存贮读取的内容。 |
返回:Integer,读取的长度。
## `ReadSections(strings)`
读INI章节的所有章节名。
对象:TIniFile
旧定义:`ReadSections(Strings:TStrings);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1601
| 参数 | 类型 | 说明 |
| --------- | -------- | ------------------------------- |
| `strings` | TStrings | TStringList类型,用于存贮章名。 |
返回:any
## `WriteBoolean(section, ident, value)`
写INI内容。
对象:TIniFile
旧定义:`WriteBoolean(Section;Ident:String;Value: Boolean);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1590
| 参数 | 类型 | 说明 |
| --------- | ------- | --------------------- |
| `section` | String | 字符串类型,节名。 |
| `ident` | String | 字符串类型,键值名。 |
| `value` | Boolean | Boolean类型,值内容。 |
返回:any
## `ReadSectionValues(section, strings)`
读INI章节的所有内容。
对象:TIniFile
旧定义:`ReadSectionValues(Section:String;Strings:TStrings);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1600
| 参数 | 类型 | 说明 |
| --------- | -------- | --------------------------------------- |
| `section` | String | 字符串类型,节名。 |
| `strings` | TStrings | TStringList类型,用于存贮章节里的内容。 |
返回:any
## `ReadBoolean(section, ident, default)`
读INI内容。
对象:TIniFile
旧定义:`ReadBoolean(Section;Ident:String;Default: Boolean): Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1589
| 参数 | 类型 | 说明 |
| --------- | ------- | ------------------------------------- |
| `section` | String | 字符串类型,节名。 |
| `ident` | String | 字符串类型,键值名。 |
| `default` | Boolean | Boolean类型,当不存在的时候的默认值。 |
返回:Boolean,读取的结果。
## `ReadSection(section, strings)`
读INI章节的所有键名。
对象:TIniFile
旧定义:`ReadSection(Section:String;Strings:TStrings);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1599
| 参数 | 类型 | 说明 |
| --------- | -------- | --------------------------------------- |
| `section` | String | 字符串类型,节名。 |
| `strings` | TStrings | TStringList类型,用于存贮章节里的键名。 |
返回:any
## `WriteFloat(section, ident, value)`
写INI内容。
对象:TIniFile
旧定义:`WriteFloat(Section;Ident:String;Value: Double);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1598
| 参数 | 类型 | 说明 |
| --------- | ------ | -------------------- |
| `section` | String | 字符串类型,节名。 |
| `ident` | String | 字符串类型,键值名。 |
| `value` | Double | 实数类型,值内容。 |
返回:any
## `WriteInteger(section, ident, value)`
写INI内容。
对象:TIniFile
旧定义:`WriteInteger(Section;Ident:String;Value: Integer);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1588
| 参数 | 类型 | 说明 |
| --------- | ------- | -------------------- |
| `section` | String | 字符串类型,节名。 |
| `ident` | String | 字符串类型,键值名。 |
| `value` | Integer | 整数类型,值内容。 |
返回:any
## `ReadFloat(section, ident, default)`
读INI内容。
对象:TIniFile
旧定义:`ReadFloat(Section;Ident:String;Default: Double): Double;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1597
| 参数 | 类型 | 说明 |
| --------- | ------ | ---------------------------------- |
| `section` | String | 字符串类型,节名。 |
| `ident` | String | 字符串类型,键值名。 |
| `default` | Double | 实数类型,当不存在的时候的默认值。 |
返回:Double,读取的结果。
## `ReadInteger(section, ident, default)`
读INI内容。
对象:TIniFile
旧定义:`ReadInteger(Section;Ident:String;Default: Integer): Integer;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1587
| 参数 | 类型 | 说明 |
| --------- | ------- | ---------------------------------- |
| `section` | String | 字符串类型,节名。 |
| `ident` | String | 字符串类型,键值名。 |
| `default` | Integer | 整数类型,当不存在的时候的默认值。 |
返回:Integer,读取的结果。
## `WriteDateTime(section, ident, value)`
写INI内容。
对象:TIniFile
旧定义:`WriteDateTime(Section;Ident:String;Value: TDateTime);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1596
| 参数 | 类型 | 说明 |
| --------- | --------- | ---------------------- |
| `section` | String | 字符串类型,节名。 |
| `ident` | String | 字符串类型,键值名。 |
| `value` | TDateTime | 日期时间类型,值内容。 |
返回:any
## `WriteString(section, ident, value)`
写INI内容。
对象:TIniFile
旧定义:`WriteString(Section;Ident;Value: string);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1586
| 参数 | 类型 | 说明 |
| --------- | ------ | -------------------- |
| `section` | string | 字符串类型,节名。 |
| `ident` | string | 字符串类型,键值名。 |
| `value` | string | 字符串类型,值内容。 |
返回:any
## `ReadDateTime(section, ident, default)`
读INI内容。
对象:TIniFile
旧定义:`ReadInteger(Section;Ident:String;Default: TDateTime): TDateTime;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1595
| 参数 | 类型 | 说明 |
| --------- | --------- | -------------------------------------- |
| `section` | String | 字符串类型,节名。 |
| `ident` | String | 字符串类型,键值名。 |
| `default` | TDateTime | 日期时间类型,当不存在的时候的默认值。 |
返回:TDateTime,读取的结果。
## `ReadString(section, ident, default)`
读INI内容。
对象:TIniFile
旧定义:`ReadString(Section;Ident;Default: string): String;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1585
| 参数 | 类型 | 说明 |
| --------- | ------ | ------------------------------------ |
| `section` | string | 字符串类型,节名。 |
| `ident` | string | 字符串类型,键值名。 |
| `default` | string | 字符串类型,当不存在的时候的默认值。 |
返回:String,读取的结果。
## `WriteDate(section, ident, value)`
写INI内容。
对象:TIniFile
旧定义:`WriteDate(Section;Ident:String;Value: TDate);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1594
| 参数 | 类型 | 说明 |
| --------- | ------ | -------------------- |
| `section` | String | 字符串类型,节名。 |
| `ident` | String | 字符串类型,键值名。 |
| `value` | TDate | 日期类型,值内容。 |
返回:any
## `SectionExists(section)`
是否存在指定章节名。
对象:TIniFile
旧定义:`SectionExists(Section: string): Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > TIniFile对象 > TIniFile的方法
Source ID1584
| 参数 | 类型 | 说明 |
| --------- | ------ | ------------------ |
| `section` | string | 字符串类型,节名。 |
返回:Boolean,是否存在。
## `DisconnectNotifyPeer()`
断开并且通知服务器。
对象:FTP
旧定义:`DisconnectNotifyPeer()`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29882
返回:any
## `SetLang(lang_tag)`
请求以指定的语言返回响应的内容。
对象:FTP
旧定义:`SetLang(const LangTag: string);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29900
| 参数 | 类型 | 说明 |
| ---------- | ------ | --------------------------------- |
| `lang_tag` | string | 字符串类型,FTP客户端的语言标记。 |
返回:any
## `ReInitialize(delay)`
清除FTP客户端的账户及其设置信息。
对象:FTP
旧定义:`ReInitialize(Delay:integer);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29894
| 参数 | 类型 | 说明 |
| ------- | ------- | -------------------- |
| `delay` | integer | 整数类型,延后时间。 |
返回:integer,整数,FTP命令的执行的结果代码。
## `ChangeDirUp()`
切换到FTP服务器上当前目录的父目录。
对象:FTP
旧定义:`ChangeDirUp();`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29878
返回:any
## `Login()`
提供FTP连接的验证,此前必须制定Username和Password属性。
对象:FTP
旧定义:`Login()`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29888
返回:any
## `ChangeDir(a_dir_name)`
改变FTP服务器上的当前目录。
对象:FTP
旧定义:`ChangeDir(const ADirName:string);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29877
| 参数 | 类型 | 说明 |
| ------------ | ------ | ------------------------------------ |
| `a_dir_name` | string | string,字符串类型,要切换到的目录。 |
返回:any
## `SetCmdOpt(cmd, options)`
指定一个在FTP命令之后的行为
对象:FTP
旧定义:`SetCmdOpt(const CMD; Options : String);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29899
| 参数 | 类型 | 说明 |
| --------- | ------ | ----------------------------------- |
| `cmd` | String | 字符串类型,受到Options影响的命令; |
| `options` | String | 字符串类型,应用于FTP 会话的选项。 |
返回:any
## `MakeDir(dir_name)`
在FTP服务器上创建目录。
对象:FTP
旧定义:`MakeDir(const DirName: string);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29889
| 参数 | 类型 | 说明 |
| ---------- | ------ | ------------------------------ |
| `dir_name` | string | 字符串类型,要创建的目录名称。 |
返回:any
## `Noop()`
向FTP服务器发送一个KEEP-ALIVE信号。服务器在长时间处于空闲状态下,使用NOOP方法可以防止服务器关闭连接。
对象:FTP
旧定义:`Noop();`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29890
返回:any
## `RetrieveCurrentDir()`
获得服务器上当前目录的名称。
对象:FTP
旧定义:`RetrieveCurrentDir: string;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29898
返回:String,当前所处的目录
## `Rename(source_file, dest_file)`
重命名FTP服务器指定文件。
对象:FTP
旧定义:`Rename(const SourceFile:string; DestFile: string);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29896
| 参数 | 类型 | 说明 |
| ------------- | ------ | ---------------------- |
| `source_file` | String | 字符串类型,源文件名。 |
| `dest_file` | String | 字符串类型,新文件名。 |
返回:any
## `ResumeSupported()`
指出服务器上是否支持REST命令。
对象:FTP
旧定义:`ResumeSupported():Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29897
返回:Boolean
## `Site(command)`
发送一个FTP服务器端的命令。
对象:FTP
旧定义:`Site(const Command: string);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29903
| 参数 | 类型 | 说明 |
| --------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `command` | string | 字符串类型,FTP服务器端命令名称。常常用来发发送没有包含在FTP协议中的服务器端命令。可以用HELP SITE命令查找指定FTP服务器的命令和语法信息。 |
返回:any
## `CRC(file_name, start_point, end_point)`
计算FTP服务器上指定文件的CRC值。需要FTP服务器支持XCRC功能。
对象:FTP
旧定义:`CRC(const FileName:string;const StartPoint:Int64;const EndPoint: Int64): Int64;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID31579
| 参数 | 类型 | 说明 |
| ------------- | ------ | --------------------------------------------------------------------------------- |
| `file_name` | string | 字符串类型,指定的文件名; |
| `start_point` | Int64 | 整数类型,计算CRC值的文件其实位置,默认为0; |
| `end_point` | Int64 | 整数类型,计算CRC值的文件末尾位置,默认为0,当指定为0时,EndPoint认为是文件长度。 |
返回:Int64,整数类型。指定文件的CRC值。
## `IsServerMDTZAndListTForm()`
指出FTP服务器是否支持FTP MDTM和LIST-T 命令。
对象:FTP
旧定义:`IsServerMDTZAndListTForm(): Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29886
返回:Boolean
## `Help(help_contents, command)`
获得FTP服务器命令以及其他帮助信息,使用FTP的HELP命令。必须在登陆连接后才可以使用Help函数。
对象:FTP
旧定义:`Help(HelpContents:TStrings;Command:string);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29885
| 参数 | 类型 | 说明 |
| --------------- | -------- | ----------------------------------------------------------------- |
| `help_contents` | TStrings | 字符串类型,用于返回服务器的执行状态信息。 |
| `command` | string | 字符串类型,可选参数,用于请求具体的命令的帮助信息,如HELP SITE。 |
返回:any
## `SetModTime(file_name, local_time)`
设置指定文件的最后修改时间。
对象:FTP
旧定义:`SetModTime(const FileName: String; const LocalTime: TDateTime);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29901
| 参数 | 类型 | 说明 |
| ------------ | --------- | ---------------------------------- |
| `file_name` | String | 字符串类型,服务器上更新的文件名; |
| `local_time` | TDateTime | 时间类型,指定文件修改的时间值。 |
返回:any
## `Status(status_list)`
实现FTP的STAT命令。
对象:FTP
旧定义:`Status(StatusList: TStrings);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29905
| 参数 | 类型 | 说明 |
| ------------- | -------- | -------------------------------------------------- |
| `status_list` | TStrings | 字符串列表类型,服务器响应的连接、传输参数等状态。 |
返回:any
## `AddAttachment()`
添加一个文件附件的消息部分。
对象:MailMsg
旧定义:`AddAttachment ():MessagePart Object;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > MailMsg对象 > MailMsg对象的方法
Source ID1795
返回:MessagePart Object
## `SetModTimeGMT(file_name, gmt_time)`
设置指定文件的最后修改时间。
对象:FTP
旧定义:`SetModTimeGMT(const FileName : String; const GMTTime: TDateTime);`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > FTP对象 > FTP对象的方法
Source ID29902
| 参数 | 类型 | 说明 |
| ----------- | --------- | ---------------------------------- |
| `file_name` | String | 字符串类型,服务器上更新的文件名; |
| `gmt_time` | TDateTime | 时间类型,指定文件修改的时间值。 |
返回:any
## `MessagePart(index)`
返回指定的消息部分。
对象:MailMsg
旧定义:`MessagePart(Index:Integer):MessagePart Object;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > MailMsg对象 > MailMsg对象的方法
Source ID1794
| 参数 | 类型 | 说明 |
| ------- | ------- | ---- |
| `index` | Integer | |
返回:MessagePart Object
## `SendCmd(cmd, cmd_result, ret_code)`
发送命令。
对象:MailMsg
旧定义:`SendCmd(Cmd:String;[Var CmdResult:String;Var RetCode:String]):Boolean;`
来源:TSL语言基础 > Object TSL > TSL内置对象使用大全 > MailMsg对象 > MailMsg对象的方法
Source ID1789
| 参数 | 类型 | 说明 |
| ------------ | ------ | ------------------------ |
| `cmd` | String | 字符串类型,发送的命令。 |
| `cmd_result` | String | 可选参数,返回的结果串。 |
| `ret_code` | String | 可选参数,返回的代码串。 |
返回:Boolean