R
Rick
I have a string value 5.2.1 and I need to know how to compare if this value
is greater than or equlas to 5.1.4
is greater than or equlas to 5.1.4
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I have a string value 5.2.1 and I need to know how to compare if this value
is greater than or equlas to 5.1.4
Rick said:Couls you please provide me with more information?
How do I load them in a version class?
Actually, I need it for VS2003 not VS2005.
Peter said:If you could explain what about the String.Compare() method doesn't
accomplish your goal, that would help us provide a better answer.
I have a string value 5.2.1 and I need to know how to compare if this
value is greater than or equlas to 5.1.4
Peter Duniho said:As Hans suggested; I've already tried the following code but it won't
work.
It compiles fine but generate an error "An exception has been thrown by
the
target of an invocation" when application is launched.
Assembly myAsm = Assembly.Load("MyApplicationNameWithoutDotEXE");
AssemblyName aName = myAsm.GetName();
Version ver = aName.Version;
The following code works fine:
using System;
using System.Reflection;
namespace TestAssemblyVersion
{
class Program
{
static void Main(string[] args)
{
// Assembly assembly = Assembly.GetExecutingAssembly();
Assembly assembly = Assembly.Load("TestAssemblyVersion");
Console.WriteLine("\"{0}\"",
assembly.GetName().Version.ToString());
Console.ReadLine();
}
}
}
It seems to me that the commented line is preferable -- your assembly
should already be loaded, so why load it again? -- but either produces the
expected output.
So, you've done something wrong. You need to post a concise-but-complete
code sample showing _exactly_ what you _are_ doing, otherwise it's not
possible to understand what the mistake is.
Pete
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.