你运气真好,昨天我刚编完这个,送给你,哈哈!!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,db, DBTables;
type
TForm1 = class(TForm)
Button1: TButton;
ListBox1: TListBox;
Table1: TTable;
Label1: TLabel;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
path :string;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
session.GetAliasParams('workdir',listbox1.Items);
path:=copy(listbox1.Items[0],6,50);
label1.Caption:=path;
label2.Caption:=inttostr(length(path));
end;
end.