|
|
Thanks Abhijit,
It talks about the general thread safety rule, not about my specific question about thread safety for string.
Any new ideas or comments?
regards,
George
|
|
|
|
|
George_George wrote: It talks about the general thread safety rule
Yes, That true. but it could also clear your doubts . Any way hope now your have got your answer.
cheers,
Abhijit
|
|
|
|
|
Thanks Abhijit,
I think all string operations are thread-safe. Since when we modify a string, a new string instance will be created. Do you think it is correct?
regards,
George
|
|
|
|
|
George_George wrote: Do you think it is correct?
Yes !!!
cheers,
Abhijit
CodeProject.Com MVP
|
|
|
|
|
Thanks Abhijit MVP!
regards,
George
|
|
|
|
|
Thats 2 more "read the docs" answers for you. That makes your tally, what, like a couple of thousand now?
|
|
|
|
|
Thanks J4amieC,
After some reading the investigation, I think my understanding is correct. Do you agree?
regards,
George
|
|
|
|
|
Yes, and no. Mostly yes, but partially no.
|
|
|
|
|
More details please?
regards,
George
|
|
|
|
|
|
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
|
|
|
|