Environmentクラス

提供: AB開発Wiki
2007年6月9日 (土) 13:16時点におけるOverTaker (トーク | 投稿記録)による版
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
ナビゲーションに移動検索に移動
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Environment クラスは、現在の環境やプラットフォームの情報を取得、または操作をすることができます。

クラス機能

メンバ・プロパティ

CommandLine

Static Function CommandLine() As String

このプロセス用のコマンドラインを取得します。

CurrentDirectory

Static Function CurrentDirectory() As String
Static Sub CurrentDirectory(cd As String)

カレントディレクトリの取得または設定をします。

ExitCode

Static Function ExitCode() As Long
Static Sub ExitCode(code As Long)

プロセスの終了コードを取得または設定します。

HasShutdownStarted

Static Function HasShutdownStarted() As Boolean

MachineName

Static Function MachineName() As String

コンピュータの名前を取得します。

NewLine

Static Function NewLine() As String

この環境で使われている改行コードを取得します。

OSVersion

Static Function OSVersion() As OperatingSystem

現在のプラットフォームIDとバージョン番号を格納しているOperatingSystemオブジェクトを取得します。

rocessorCount

Static Function ProcessorCount() As Long

現在のコンピュータのプロセッサ数を取得します。

SystemDirectory

Static Function SystemDirectory() As String

システムディレクトリの絶対パスを取得します。

TickCount

Static Function TickCount() As Long

コンピュータが起動してからの時間を、ミリ秒単位で取得します。

UserName

Static Function UserName() As String

スレッドを開始したユーザー名を取得します。

WorkingSet

 Static Function WorkingSet() As Int64

プロセスコンテキストに割り当てられる物理メモリ量を取得します。※NT系OSのみ

公開メソッド

Exit

Static Sub Exit(exitCode As Long)
exitCode
プロセスの終了コードを指定します。

このプロセスを終了し、exitCodeで指定した終了コードをオペレーティングシステムに渡します。

ExpandEnvironmentVariables

Static Function ExpandEnvironmentVariables(s As String) As  String
s
環境変数が含まれる文字列を指定します。

指定した文字列に含まれる環境変数の名前を、その変数の値で置き換えた文字列を取得します。

FailFast

Static Sub FailFast(message As String)

GetEnvironmentVariable

Static Function GetEnvironmentVariable(variable As String) As String
variable
環境変数名を指定します。

指定した名前の、現在のプロセスの環境変数を取得します。

GetFolderPath

Static Function GetFolderPath(f As Environment_SpecialFolder) As  String
f
Environment_SpecialFolder 列挙体を指定します。

指定した列挙体で識別される、システム固有のフォルダへのパスを取得します。

SetEnvironmentVariable

現在のプロセスの環境変数の作成、変更、削除を行います。

Static Sub SetEnvironmentVariable(variable As String, value As String)
variable
環境変数名を指定します。
value
値を指定します。

variableの環境変数を、valueの値で設定します。variableで指定した環境変数が存在しない場合、その環境変数を作成します。また、既に存在する名前の環境変数をvariableで指定し、valueに空の値を設定することにより、その環境変数を削除することができます。