|
That doesn't give the user a good experience. I'd hate to have an application tell me "You can't use feature x because you don't have MyWizzyFramework 3.91 installed." Put the .NET Framework as a required resource in your setup project so that it is installed up front (if they don't already have it installed).
|
|
|
|
|
thanks, you are right, I agree with you completely.
but I provide two choices to the user with similar functions, but the better one is only supported by .net Framework 3.5.
I just want my application more flexible to the user, he can select which function he want to use.
|
|
|
|
|
The following code will give you the list of available versions.
const string regLocation = "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP";
RegistryKey masterKey = Registry.LocalMachine.OpenSubKey(regLocation);
RegistryKey tempKey;
string[] SubKeyNames = masterKey.GetSubKeyNames();
for( int i = 0 ; i < SubKeyNames.Length ; i++ )
{tempKey = Registry.LocalMachine.OpenSubKey(regLocation + "\\" + SubKeyNames[ i ]);
MessageBox.Show(SubKeyNames[ i ]);
MessageBox.Show("\tVersion = {0}", tempKey.GetValue("Version").ToString());
}
Or you can check the currently user version using the following.
MessageBox.Show(Environment.Version.ToString());
|
|
|
|
|
Environment.Version always returns the CLR version, not the current framework version. For .NET 2.0, 3.0, and 3.5, Environment.Version returns 2.0.50727.3053, since 3.0 and 3.5 are just API extensions to 2.0.
|
|
|
|
|
Dear All,
I need to prepare printable coupons for my clients but don't know how to use the same template to make multiple copies. The number of coupons the client needs depends on the number ordered. I have designed a coupon template in html table format. How can I create multiple copies using only 1 template?
Thanks for that.
|
|
|
|
|
You should post this type of inquiry to the Web Development forum. I've accomplished this using the Repeater control in ASP.NET. You can use the <%# ... %> syntax in the ASPX page to plug in record data; do a little Googling on the subjects and you should be set.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
public class Command
{
public int Number;
public int NoOfParameters;
}
Command[] Querries = new Command[50];
private void button_Click(object sender, EventArgs e)
{
initialization()
Device mydevice = new Device();
int Add = mydevice.FindAddress();
}
public int FindAddress()
{
SendCommand (Querries[0])
}
My initialization method already initialize all Querries[i].Number and Querries[i].NoOfParameters.
But when the code is run to SendCommand (Querries[0]), the values of Querries[i] is still null?
Why is it so, and how to solve it ?
Thanks
|
|
|
|
|
Hi,
how does your initialization()-method look like? Maybe you could post the code, this could help us to find the problem.
Regards
Sebastian
|
|
|
|
|
Can you show the Initialization() method ?
Jean-Christophe Grégoire
|
|
|
|
|
private void initialization()
{
Command[] Querries = new HARTCommand[50];
XmlDocument Reader = new XmlDocument();
Reader.Load("Myfile.xml");
XmlNodeList List = Reader.SelectNodes("/Common/Command");
foreach (XmlNode commandnode in List)
{
int i = int.Parse(commandnode.Attributes["value"].InnerText);
int type= int.Parse(commandnode.Attributes["Para"].InnerTect);
Querries[i] = new Command();
Querries[i].CommandNumber = i;
Querries[i].NoOfParameters= type;
}
}
I run the code ,and the initialization is working fine.
|
|
|
|
|
sorry, corrected one is here
private void initialization()
{
Command[] Querries = new Command[50];
XmlDocument Reader = new XmlDocument();
Reader.Load("Myfile.xml");
XmlNodeList List = Reader.SelectNodes("/Common/Command");
foreach (XmlNode commandnode in List)
{
int i = int.Parse(commandnode.Attributes["value"].InnerText);
int type= int.Parse(commandnode.Attributes["Para"].InnerTect);
Querries[i] = new Command();
Querries[i].CommandNumber = i;
Querries[i].NoOfParameters= type;
}
}
I run the code ,and the initialization is working fine.
|
|
|
|
|
The problem you have is because "Querries" is defined as a class-level property, but you're redefining it as a local variable in the initialization method. This locval copy is the one you're initializing, not the class-level one you go on to try to use.
|
|
|
|
|
thanks , but Even if i put whole dose of initialization inside button_Click(object sender, EventArgs e), it is still the same ?
|
|
|
|
|
Thanks, ALready solve it
|
|
|
|
|
There must be dozens of your classmates that have already asked this question here. Just because you make the space for 50 instances of your object, doesn't at all mean that you've instantiated the object 50 times. For christ's sake, read your freakin' text books.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Do not be mad. In fact, the real problem is that the var he defined in Initializer method override the class field. Maybe the code is not clear enough.
Tan Li
I Love KongFu~
|
|
|
|
|
Dear all,
Application developed using VS2005 c#, and deployed using click-once, In one of the pc the application runs perfect first time, but when we restart the pc application throws below error message:
ApplicationName.exe .net framework inilization error
Unable to find a runtime version to run this application
But It runs fine with other PC's , only this PC have problem,
I have already googled but not found any solutions for the problem.
Please help....
Thanks & Regards,
Bhaskar Shetty
Bhaskar Shetty
|
|
|
|
|
Hi,
maybe the .NET framework is needed?
|
|
|
|
|
Hi,
.net framework and all pre-requets are already installed.
Is it becuase of any virus infection??
Thanks & Regards,
Bhaskar Shetty
|
|
|
|
|
Probably not, though without scanning the machine with virus software, there's really no way to tell.
Your other option is to rebuild the PC, since this is a really strange problem. I've never seen this happen before.
|
|
|
|
|
Hi,
Even tried Re-building the whole PC's, but problem persists...
Thanks & Regards,
Bhaskar Shetty
|
|
|
|
|
Man, you have a shetty understanding of computers, don't you.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
What do you mean by this...
Bhaskar Shetty
|
|
|
|
|
He means to troll...like a good outlaw programmer.
|
|
|
|
|
well
that's probably a virus, which i still can't pinpoint, or find a solution for
1 - my home pc was infected and it gave 0xc000007b error (initialization error) something like that to alll .net built assemblies
2 - now i have my pc at work who is infected, and gives me the error you just described.
Now can you confirm that when you rebuild one of your own assemblies, and try to run it ...it runs correctly and after you close it, a couple of minutes, the file size changes just like that, and the problem starts?
if you insert a USB drive, you'll have two infected files on it, they are hidden ... the first is 'autorun.inf' and the second is totally random, having an executable extension (such as .exe, .pif, ......)?
|
|
|
|