本文整理汇总了C#中System.Version.Format方法的典型用法代码示例。如果您正苦于以下问题:C# Version.Format方法的具体用法?C# Version.Format怎么用?C# Version.Format使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Version
的用法示例。
在下文中一共展示了Version.Format方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Constants
static Constants()
{
var assembly = Assembly.GetExecutingAssembly();
var name = assembly.GetName();
ApplicationTitle = "Tailviewer";
ApplicationVersion = name.Version;
BuildDate = GetLinkerTime(assembly);
MainWindowTitle = string.Format("Tailviewer, v{0}", ApplicationVersion.Format());
ProjectPage = new Uri("https://kittyfisto.github.io/Tailviewer/");
GithubPage = new Uri("https://github.com/Kittyfisto/Tailviewer");
ReportBugPage = new Uri("https://github.com/Kittyfisto/Tailviewer/issues/new");
ApplicationFolder = assembly.GetFolder();
AppDataLocalFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), ApplicationTitle);
DownloadFolder = Path.Combine(AppDataLocalFolder, "Downloads");
}
示例2: RefreshS3Location
private void RefreshS3Location()
{
var webConfigFile = Path.Combine(ContentFolder, "web.config");
var formattedVersion = LastFormattedVersion;
if (!File.Exists(webConfigFile))
return;
var dt = File.GetLastWriteTimeUtc(webConfigFile);
if (uxS3BucketComboBox.Text.Length == 0 || uxSubfolderComboBox.Text.Length == 0)
{
uxS3LocationTextBox.Text = string.Empty;
return;
}
if (webConfigFile != LastWebConfigFile || dt != WebConfigTimestamp)
{
WebConfigTimestamp = dt;
LastWebConfigFile = webConfigFile;
var doc = new XmlDocument();
doc.Load(webConfigFile);
var xPath = "/configuration/appSettings/add[@key='VersionNumber']/@value";
var nodes = doc.SelectNodes(xPath);
if (nodes.Count > 0)
{
var v = nodes[0].Value;
var ver = new Version(v);
formattedVersion = ver.Format();
}
}
LastFormattedVersion = formattedVersion;
S3Path = string.Format("s3://{0}/{1}", uxS3BucketComboBox.Text,
uxSubfolderComboBox.Text.ToLowerInvariant());
ZipFile = string.Format("pkg-{0}-{1:00}.zip", formattedVersion, uxPackageVersionUpDown.Value);
uxS3LocationTextBox.Text = S3Location;
uxS3LocationTextBox.Refresh();
}