VFP9.0SP2中的MY組件幫助譯文(三)

字號:

My 命名空間
     My 有一些命名空間(直接映射到My.VCX)。最的命名空間是 My,作爲(wèi)其他 My 命名空間的父類。 My麾下有5個命名空間:
    My.App:提供程序方法和屬性
    My.Computer:提供訪問計算機(jī)組件可變的組件
    My.Data:提供數(shù)據(jù)手動化的性能
    My.Settings:提供程序設(shè)置
    My.User:提供當(dāng)前用戶的信息
    My
    My
    在My系統(tǒng)中,MY是其他命名空間的父類。其本身沒有任何屬性和方法。
    --------------------------------------------------------------------------------
    My.App
    提供應(yīng)用程序的方法和屬性。
    類成員
    成員
    描述
    Execute
    執(zhí)行指定的文件。
    My.App.Execute(FileName as String [, Operation as String
    [, WorkingFolder as String [, OtherParameters as String]]]) as Integer
    前置要求:無
    My.App.Execute
    功能:執(zhí)行指定的文件
    用法:My.App.Execute(FileName as String [, Operation as String
    [, WorkingFolder as String [, OtherParameters as String]]]) as Integer
    返回值:
    一個數(shù)值代號,指明狀態(tài):
    -1: 如果沒有傳遞文件名
    2: 壞的關(guān)聯(lián)
    29: 裝入程序失敗
    30: 程序忙
    31: 沒有程序關(guān)聯(lián)
    超過 32的值,表明成功,并且返回程序的的實例句柄
    參數(shù)
    FileName as String
    要用來執(zhí)行的文件的名稱和路徑
    Operation as String
    The operation to perform. Optional; if it isn't specified, "Open" is used.
    WorkingFolder as String
    文件的工作目錄??蛇x。
    OtherParameters as String
    其他的參數(shù)傳遞給程序,用來管理文件的
    范例
    local My as My
    My = newobject('My', 'My.vcx')
    lcFile = fullpath('roadmap.html')
    erase (lcFile)
    lnResult = My.Computer.Network.DownloadFile('http://msdn.microsoft.com/vfoxpro/roadmap', ;
    lcFile)
    if lnResult = 0
    My.App.Execute(lcFile)
    endif lnResult = 0
    參見:
    My.App 類
    My.App.Info
    包含程序特定的屬性
    類成員
    成員
    描述
    GetApplicationInformation
    得到有關(guān)特定程序的信息
    My.App.Info.GetApplicationInformation(EXEPath as String)
    GetCurrentApplicationInformation
    得到當(dāng)前程序的信息My.App.Info.GetCurrentApplicationInformation()
    Comments
    程序的內(nèi)容。只讀。
    CompanyName
    公司名稱。只讀。
    Copyright
    版權(quán)。只讀。
    Description
    程序的描述。只讀。
    DirectoryPath
    程序運行的目錄。只讀。
    InternalName
    程序的內(nèi)部名稱。只讀。
    Language
    程序的語言。只讀。
    OLESelfRegister
    .T.,如果 EXE 是自注冊的。只讀。
    OriginalFileName
    原來的文件名稱。只讀。
    PrivateBuild
    私有的版本。只讀。
    ProductName
    產(chǎn)品名稱。只讀。
    ProductVersion
    產(chǎn)品的版本數(shù)。只讀。
    SpecialBuild
    特別的版本。只讀。
    Trademarks
    程序的商標(biāo)。只讀。
    TranslationCode
    翻譯代碼;參見Visual FoxPro 幫助主題 AGETFILEVERSION() 以知得更多。只讀。
    Version
    程序的版本數(shù)。只讀。
    前置要求:無
    My.App.Info.GetApplicationInformation
    功能:得到關(guān)于指定程序的信息。
    用法:My.App.Info.GetApplicationInformation(EXEPath as String)
    參數(shù):EXEPath as String
    要查知信息的的 EXE 文件路徑和名稱。
    備注
    在參考例如公司名稱或者版本之前,調(diào)用此方法。
    范例
    local My as My
    My = newobject('My', 'my.vcx')
    My.App.Info.GetApplicationInformation('C:\Program Files\MyApp\MyApp.EXE')
    messagebox(My.App.Info.Version)
    參見:
    My.App.Info | My.App.Info.GetCurrentApplicationInformation