如果需要查看更多文章,請微信搜索公眾號 csharp編程大全,需要進C#交流群群請加微信z438679770,備注進群, 我邀請你進群! ! !
-------------------------------------------------------------------------------------------------------
AssemblyInfo.cs中
//build 等于自當地時間 2000 年 1 月 1 日以來的天數
//revision等于自當地時間午夜以來的秒數/2
// 可以指定所有這些值,也可以使用“生成號”和“修訂號”的默認值,
// 方法是按如下所示使用“*”:
//專案版本一般由主版本、次版本、內部版本、修改版本四個部分組成
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]
也可以在屬性中改:

using System.Reflection;
var version = Assembly.GetExecutingAssembly().GetName().Version;
string Version = version.ToString();
string DateTime = System.IO.File.GetLastWriteTime(this.GetType().Assembly.Location).ToString();
String LogPath = Environment.CurrentDirectory;
if (!Directory.Exists(LogPath))
Directory.CreateDirectory(LogPath);
if (!File.Exists(LogPath + "\\README.txt"))
File.Create(LogPath + "\\README.txt").Close();
string fileName = LogPath + "\\README.txt";
string content = "軟體版本:"+Version + " 生成時間:" + DateTime;
content += "\n軟體說明:********************";
using (StreamWriter sw = new StreamWriter(fileName, false))
{
sw.Write(content);
sw.Close(); sw.Dispose();
}
然后軟體目錄下會生成readme:
=------------

---------------------------------------------------------------------------------------------------------------------
如果需要查看更多文章,請微信搜索公眾號 csharp編程大全,需要進C#交流群群請加微信z438679770,備注進群, 我邀請你進群! ! !
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/168965.html
標籤:.NET技术
上一篇:C# 軟體開機啟動
下一篇:C#自定義控制元件的創建
