You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
namespace DotnetDemo.CApp
{
internal class Program
{
static void Main ( string [ ] args )
{
Console . WriteLine ( "===================== 程序开始执行 =====================" ) ;
if ( args ! = null & & args ? . Length > 0 )
{
Console . WriteLine ( $"共有{args?.Length}个命令行参数,分别是[{string.Join(" | ", args ?? new string[]{})}]" ) ;
}
else
{
Console . WriteLine ( "没有命令行参数" ) ;
}
#if DEBUG
Console . WriteLine ( "构建模式: Debug" ) ;
# else
Console . WriteLine ( "构建模式: Realse" ) ;
# endif
Console . WriteLine ( $"操作系统版本:{System.Environment.OSVersion}" ) ;
Console . WriteLine ( $"64位操作系统: {System.Environment.Is64BitOperatingSystem}" ) ;
Console . WriteLine ( $"主机名:{System.Environment.MachineName}" ) ;
Console . WriteLine ( $"系统帐户名:{System.Environment.UserName}" ) ;
Console . WriteLine ( $"程序域:{System.Environment.UserDomainName}" ) ;
Console . WriteLine ( $"用户交互模式:{System.Environment.UserInteractive}" ) ;
Console . WriteLine ( $"进程数:{System.Environment.ProcessorCount}" ) ;
Console . WriteLine ( $"进程标识:{System.Environment.ProcessId}" ) ;
Console . WriteLine ( $"64位进程: {System.Environment.Is64BitProcess}" ) ;
Console . WriteLine ( $"线程托管ID: {System.Environment.CurrentManagedThreadId}" ) ;
Console . WriteLine ( $"当前目录:{System.Environment.CurrentDirectory}" ) ;
Console . WriteLine ( $"程序文件:{System.Environment.ProcessPath}" ) ;
Console . WriteLine ( "===================== 程序运行结束 =====================" ) ;
}
}
}