程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> Delphi >> 使用 IntraWeb (30)

使用 IntraWeb (30)

編輯:Delphi


TIWAppInfo  //IntraWeb 12.2.15 開始使用 TIWAppInfo 來獲取應用的相關信息, 和 IWServerController、WebApplication 的某些屬性有重復
TIWAppCache //IntraWeb 14.0.29 新增, 可以方便處理緩存文件; 之前有類似的功能, 如: IWServerController.NewCacheFile

{兩個類提供的都是 class 方法, 使用時無須實例化}


TIWAppInfo 所在單元及繼承鏈:
IW.Common.AppInfo.TIWAppInfo < TObject

主要成員:
class function GetAppFullFileName: string
class function GetAppFileName: string
class function GetAppLogFileName: string
class function GetAppPath: string
class function GetAppName: string
class function GetSystemPath: string
class function GetTempPath: string
class function GetCurrentPath: string
class function GetComputerName: string
class function GetFileInfo(const aFileName: string; aFileInfo: TFileInfo): string
class function GetAppVersion: string


測試:
uses IW.Common.AppInfo;

procedure TIWForm1.IWButton1Click(Sender: TObject);
var
  str: string;
  i: Integer;
begin
  IWMemo1.Lines.Add(TIWAppInfo.GetAppFullFileName);
  IWMemo1.Lines.Add(TIWAppInfo.GetAppFileName);
  IWMemo1.Lines.Add(TIWAppInfo.GetAppLogFileName);
  IWMemo1.Lines.Add(TIWAppInfo.GetAppPath);
  IWMemo1.Lines.Add(TIWAppInfo.GetAppName);
  IWMemo1.Lines.Add(TIWAppInfo.GetSystemPath);
  IWMemo1.Lines.Add(TIWAppInfo.GetTempPath);
  IWMemo1.Lines.Add(TIWAppInfo.GetCurrentPath);
  IWMemo1.Lines.Add(TIWAppInfo.GetComputerName);
  IWMemo1.Lines.Add(TIWAppInfo.GetAppVersion);
  IWMemo1.Lines.Add('===============');

  for i := 0 to 9 do
  begin
    str := TIWAppInfo.GetFileInfo(TIWAppInfo.GetSystemPath + 'NotePad.exe', TFileInfo(i));
    IWMemo1.Lines.Add(str);
  end;
  IWMemo1.Lines.Add('===============');
end;



TIWAppCache 所在單元及繼承鏈:
IWAppCache.TIWAppCache < TObject

主要成員:
class function NewTempFileName: string
               //
class function AddFileToCache(aOwner: TObject; const aFileName: string; const aContentType: string; const aCacheType: TCacheType): string
               //
class procedure NewCacheStream(aOwner: TObject; const aContentType: string; aCacheType: TCacheType; out ACacheStream: TCacheStream; out aFileHRef: string)
                //
class procedure NewAppCacheStream(aOwner: TObject; const aContentType: string; out ACacheStream: TCacheStream; out aFileHRef: string)
                //
class procedure NewSessionCacheStream(aOwner: TObject; const aContentType: string; out ACacheStream: TCacheStream; out aFileHRef: string)
                //
class procedure NewFormCacheStream(aOwner: TObject; const aContentType: string; out ACacheStream: TCacheStream; out aFileHRef: string)
                //
class function StreamToCacheFile(aOwner: TObject; AStream: TStream; const aContentType: string; const aCacheType: TCacheType): string
               //
class function GraphicToCacheFile(aOwner: TObject; AGraphic: TGraphic; const aCacheType: TCacheType; const PreferPNG: Boolean): string
               //
class function GraphicToCacheFile(aOwner: TObject; AGraphic: TGraphic; imgType: TIWImageOutput; const aCacheType: TCacheType): string
               //
class function ResourceToCacheFile(aOwner: TObject; const aResourceName: string; const aContentType: string; const aCacheType: TCacheType): string
               //
class function ClearCache(ACacheList: TStrings): Integer
               //


//待續...

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved