C# Application.ProductVersion,命令应用程序等效于什么?

C# Application.ProductVersion,命令应用程序等效于什么?,c#,C#,我试图将“更新”功能添加到我正在创建的工具中,我遵循了制作更新按钮的教程,但我的应用程序是命令应用程序。我将所有messagebox更改为console.writeline,但有一部分不工作。帮忙 Console.WriteLine("Now Checking for updates.\nPlease be patient as we check for updates."); WebRequest request = WebRequest.Create(

我试图将“更新”功能添加到我正在创建的工具中,我遵循了制作更新按钮的教程,但我的应用程序是命令应用程序。我将所有messagebox更改为console.writeline,但有一部分不工作。帮忙

Console.WriteLine("Now Checking for updates.\nPlease be patient as we check for updates.");
                    WebRequest request = WebRequest.Create("http://WEBSITE.com/TEXT/FILE");
                    WebResponse response = request.GetResponse();
                    System.IO.StreamReader sr = new System.IO.StreamReader(response.GetResponseStream());
                    string newestversion = sr.ReadToEnd();
                    string currentversion = ***Application***.ProductVersion;
                    Version vOnline = new Version(newestversion);
                    Version vLocal = new Version(currentversion);
                    if (vOnline > vLocal)
                    {
                        Console.WriteLine("Update Found!\nNewest Version: " + newestversion + ".");
                    }
                    else if (vLocal == vOnline)
                    {
                        Console.WriteLine("No Updates Found.\nYou are on the newest version.");
                    }
                    else if (vLocal > vOnline)
                    {
                        Console.WriteLine("No Updates Found.\nYou are on a pre-release version of the program.");
                    }
我应该用什么来代替应用程序来让它工作?我是C语言的新手,所以非常感谢您的帮助

不是确切的函数,但是Assembly.GetEntryAssembly.GetName.Version可以执行