



原文名称:"Powered by Delphi" Logo Images
原文日期:2005-05-24
原文地址:http://delphi.about.com/library/weekly/aa052405a.htm
About Delphi Programming (http://delphi.about.com) 文章中译版及 CodeGear(Borland) Delphi 开发工具相关资讯
......
if (TObject(GetOrdProp(DataSet, FPropInfo)) as TStrings) <> nil then
SQLPropValue := (TObject(GetOrdProp(DataSet, FPropInfo)) as TStrings).Text
......
......
if TObject(GetOrdProp(DataSet, FPropInfo)) is TStrings then
SQLPropValue := (TObject(GetOrdProp(DataSet, FPropInfo)) as TStrings).Text
else if TObject(GetOrdProp(DataSet, FPropInfo)) is TWideStrings then
SQLPropValue := (TObject(GetOrdProp(DataSet, FPropInfo)) as TWideStrings).Text
else
Exit;
......
{$WARN UNIT_PLATFORM OFF}
begin
ListBox1.Items.Add('First'^I'Second'^I'Third') ;
ListBox1.Items.Add('C1R1'^I'C2R1'^I'C3R1') ;
ListBox1.Items.Add('C1R2'^I'C2R2'^I'C3R2') ;
ListBox1.Items.Add('C1R3'^I'C2R3'^I'C3R3') ;
ListBox1.Items.Add('C1R4'^I'C2R4'^I'C3R4') ;
ListBox1.Items.Add('C1R5'^I'C2R5'^I'C3R5') ;
ListBox1.Items.Add('C1R6'^I'C2R6'^I'C3R6') ;
ListBox1.Items.Add('C1R7'^I'C2R7'^I'C3R7') ;
ListBox1.Items.Add('C1R8'^I'C2R8'^I'C3R8') ;
ListBox1.Items.Add('C1R9'^I'C2R9'^I'C3R9') ;
end;
webBrowser1.Navigate('http://delphi.about.com') ;
webBrowser1.Navigate('about:blank') ;
procedure WBLoadHTML(WebBrowser: TWebBrowser; HTMLCode: string) ;
var
sl: TStringList;
ms: TMemoryStream;
begin
WebBrowser.Navigate('about:blank') ;
while WebBrowser.ReadyState < READYSTATE_INTERACTIVE do
Application.ProcessMessages;
if Assigned(WebBrowser.Document) then
begin
sl := TStringList.Create;
try
ms := TMemoryStream.Create;
try
sl.Text := HTMLCode;
sl.SaveToStream(ms) ;
ms.Seek(0, 0) ;
(WebBrowser.Document as IPersistStreamInit).Load(TStreamAdapter.Create(ms)) ;
finally
ms.Free;
end;
finally
sl.Free;
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject) ;
var
sHTML : string;
begin
sHTML := 'GOTO' +
'About Delphi Programming';
WBLoadHTML(WebBrowser1,sHTML) ;
end;
function GetComputerNetName: string;
var
buffer: array[0..255] of char;
size: dword;
begin
size := 256;
if GetComputerName(buffer, size) then
Result := buffer
else
Result := ''
end;
Function GetUserFromWindows: string;
Var
UserName : string;
UserNameLen : Dword;
Begin
UserNameLen := 255;
SetLength(userName, UserNameLen) ;
If GetUserName(PChar(UserName), UserNameLen) Then
Result := Copy(UserName,1,UserNameLen - 1)
Else
Result := 'Unknown';
End;