SQLの窓

2009年12月03日


VB.net : アプリケーションディレクトリ

概要
exe が存在するディレクトリです。通常、設定ファイル等を開く時に必要になります。
上のほうは、VB として用意されているもので、下は同じものですが
Framework として取り出しています
' VB 的 アプリケーションディレクトリ
Console.WriteLine(My.Application.Info.DirectoryPath)

' Freamework 的 アプリケーションディレクトリ
Dim thisA As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
Dim info As Microsoft.VisualBasic.ApplicationServices.AssemblyInfo = _
 New Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(thisA)
Console.WriteLine(info.DirectoryPath)

以下は C# で書いたものです
// Freamework 的 アプリケーションディレクトリ 
System.Reflection.Assembly thisA = System.Reflection.Assembly.GetExecutingAssembly(); 
Microsoft.VisualBasic.ApplicationServices.AssemblyInfo info = 
	new Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(thisA); 
System.Console.WriteLine(info.DirectoryPath); 

// ビルド例
// csc /r:%windir%\Microsoft.NET\Framework\v2.0.50727\Microsoft.VisualBasic.dll info.cs



関連する記事


タグ:VB.NET
posted by lightbox at 2009-12-03 05:52 | VB.NET : ベーシック | このブログの読者になる | 更新情報をチェックする
container 終わり



フリーフォントで簡単ロゴ作成
フリーフォントでボタン素材作成
フリーフォントで吹き出し画像作成
フリーフォントではんこ画像作成
ほぼ自由に利用できるフリーフォント
フリーフォントの書体見本とサンプル
画像を大きく見る為のウインドウを開くボタンの作成

CSS ドロップシャドウの参考デモ
イラストAC
ぱくたそ
写真素材 足成
フリーフォント一覧
utf8 文字ツール
右サイド 終わり
base 終わり