//MyDocument内のパス取得 string dirMyDoc = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + “\\xvax"; //パス上にディレクトリ存在しない場合 if ( Directory.Exists(dirMyDoc) == false ) { //ディレクトリ作成 Directory.CreateDirectory( Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + “\\xvax" ); } //NT LOGIN Name using System.Runtime.InteropServices; [DllImport("Advapi32.dll", EntryPoint = "GetUserName", ExactSpelling = false, SetLastError = true)] static extern bool GetUserName([MarshalAs(UnmanagedType.LPArray)] byte[] lpBuffer, [MarshalAs(UnmanagedType.LPArray)] Int32[] nSize); byte[] str = new byte[256]; Int32[] len = new Int32[1]; len[0] = 256; GetUserName(str, len); //ex lblLogName.Text = System.Text.Encoding.ASCII.GetString(str);