environment所有的用法,environment前面为何加the

首页 > 经验 > 作者:YD1662024-03-31 18:16:46



在C#中,Environment类提供了许多有用的方法和属性,用于获取和操作与当前环境相关的信息。

Environment类一些常见的用法示例:

string osVersion = Environment.OSVersion.ToString();

string machineName = Environment.MachineName;

string userName = Environment.UserName;

string currentDirectory = Environment.CurrentDirectory;

int processorCount = Environment.ProcessorCount;

string[] commandLineArgs = Environment.GetCommandLineArgs();

Version version = Assembly.GetEntryAssembly().GetName().Version; string appVersion = version.ToString();

long workingSet = Environment.WorkingSet;

string systemDirectory = Environment.SystemDirectory;

Version clrVersion = Environment.Version; string clrVersionString = clrVersion.ToString();

DateTime startTime = Process.GetCurrentProcess().StartTime;

int exitCode = Environment.ExitCode;

environment所有的用法,environment前面为何加the(1)

栏目热文

文档排行

本站推荐

Copyright © 2018 - 2021 www.yd166.com., All Rights Reserved.