|
I think the reason why all methods of string class are thread safe is because string is immutable, i.e. when the string is modified, a new instance is created. Agree or?
regards,
George
|
|
|
|
|
OMG dude...you already have the friggin answer.
You've been told the answer is correct several times already.
Your request for agreement has been fulfilled already.
WHAT MORE CAN YOU POSSIBLY EXPECT?
|
|
|
|
|
Thanks Jon!
Sorry I missed some emails. I am relying on Yahoo! email box to notify me the answers.
regards,
George
|
|
|
|
|
Hello to all
I have problem with property grid. I am adding label object to property grid and want to show some specific property of label. But propertygrid shows all properties.
Please help me out how can i skip some property of label.
Thanks in advance.
|
|
|
|
|
I am afraid we can not do this for defined control, such as Textbox. But we can set the visible property for custom control(e.g. MyTextbox) via Browserable attribute. If we want to expose some certain property from Textbox, we can hold the reference in MyTextbox object. For example:
class MyTextbox
{
TextBox textbox;
public string Text
{
get
{
return this.textbox.Text;
}
set
{
this.textbox.Text = value;
}
}
}
Hope this will help you ~
Tan Li
I Love KongFu~
|
|
|
|
|
It is known that some functions are supported by .net Framework 3.5.
therefore, how to detect automatically that .net framework 3.5 is already installed on the current computer?
in order to give the message to the user when the user try to use some functions only supported by .net framework 3.5?
thanks.
|
|
|
|
|
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
|
|
|
|