当前位置: 首页>>代码示例>>C#>>正文


C# Version.Format方法代码示例

本文整理汇总了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");
        }
开发者ID:Kittyfisto,项目名称:Tailviewer,代码行数:16,代码来源:Constants.cs

示例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();
        }
开发者ID:pgjasinski,项目名称:AwsCodeDeployUtility,代码行数:44,代码来源:MainForm.cs


注:本文中的System.Version.Format方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。