// SystemUserName.cpp : メイン プロジェクト ファイルです。 #include "stdafx.h" using namespace System; int main(array ^args) { String^ UserName = System::Environment::UserName; Console::WriteLine("ログインユーザ名: {0}", UserName); return 0; }