|
Read about thread apartments here[^]
|
|
|
|
|
Thnak you so much, good link!
But quickly, what's the difference if i set the main form in STAThread or MTAThread?
Tnx
bye
|
|
|
|
|
frommi wrote: But quickly, what's the difference if i set the main form in STAThread or MTAThread?
You mean you are too lazy to read the article? That is essentially what that question says. You want someone to spoon feed you the information and then clean up any dribbles?
|
|
|
|
|
No, i have read the article, and i have understood that if i set the main thread in STA is correct why ActiveX are STA for default, and if you don't set main thread in STA mode you can have some problem with clipboard.
The last problem is my case.
Now i have understood, thank you...
|
|
|
|
|
Why even respond if your not helping out. how RUDE of you to assume. I so tire of pompus meaningless replys like yours frommi. Replies like yours certainly dont help the community.
|
|
|
|
|
I want to create static constructors for dropdownlist.
I have dropdownlist like "ddlState" on my page.As state data of dropdownlist will change very rarely,So I want to create static constructor for dropdownlist.
Is it possible?? If yes,how can I do this??
Likewise "ddlState" I have another dropdownlists on my page..for which i have to do same functionality.
|
|
|
|
|
Hi Guys,
I am trying to delete a file via C#.NET console application. As you all know, that in C programming we have a function called 'remove' which deletes any particular file, as allocated to. I know that we also have something like that in C#, but I am unable to make it out. I want to delete the file of the following path:
D:/My Folder/xxxx.txt
Please Help me out! Your help will be appreciated....thanx for taking interest in my question.
|
|
|
|
|
System.IO.File.Delete(@"D:/My Folder/xxxx.txt");
|
|
|
|
|
Thanx freak!
It really worked!
|
|
|
|
|
|
Using this:
File.Delete("D:/My Folder/xxxx.txt");
|
|
|
|
|
You can look at the FilInfo Class. Something like this.
private void DeleteFiles()
{
DirectoryInfo info = new DirectoryInfo(this.textBox1.Text);
foreach (FileInfo info2 in info.GetFiles("*.done"))
{
File.Delete(info2.FullName);
}
MessageBox.Show("Completed Processing", "Processing Info", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
Hope this helps.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Hi,
I am trying to compare data if user select date for birth date field then it will compare today's data and subtract it by 18 year if it is valid then process further other wise send Alert Message that you are not eligible.
For this all what i have to do i am also searching it.
Please do replay.
Thanks
|
|
|
|
|
Check the datetime object...
It consist of many functions which you can use...
|
|
|
|
|
This is such a common thing that I'd be willing to bet that someone, somewhere, must have done it before. What do you think?
For goodness sake learn to use Google 'calculate age c#' should do the trick.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
I have a folder which contain number of files, i want to upload this folder to ftp. Without zip how can i save this folder in the server.
Thankyou
YPKI
|
|
|
|
|
if i sign the application manifest, is it possible to read the public key value from the program
Thank you in advance
William
|
|
|
|
|
If the certificate (or certificates) are embedded in the signature you can extract the public key from that certificate. Be wary that a signature can have more than on certificate included, this happens when you include the whole chain and not just the certificate used to sign.
|
|
|
|
|
Hi,
I have a string '0ImgToSend.59000.dtl', I need to get the value between '.', ie 59000, whith out using array haw can i get the value using simple string manipulation.
Thankyou
YPKI
|
|
|
|
|
Will it always have that many characters? If it does, you can use value.Substring(12, 4); If the location of the periods change, you can use IndexOf to find their location and use that within Substring.
Hope that helps,
-Kalivos
|
|
|
|
|
arsing strings differs greatly depending on the strongs you have to parse.
If you know the format will always be the same, i.e. "." marks the beginning and again the end of the value you want to retrieve, you can IndexOf() to get these positions and then use them to calcualte the substring that can contsin a vaule.
Then use int.Tryparse (all number types have TryParse methods) to convert the value to a number.
Thhis methods returns a bool that tells you if the parsing was successful or not.
|
|
|
|
|
Megidolaon wrote: arsing strings differs greatly depending on the strongs you have to parse
Is your spell-checker turned off?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
My brain was turned off.
|
|
|
|
|
If the format of the string is always the same, and there are only ever going to be two '.'s in it then use String.Split .
Off the top of my head something like:
string[] parts = myinputstring.Split(".".ToCharArray());
string numericBit = parts[1];
Hope this helps.
But as I have done this from memory, PLEASE look up the Split Method first.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Henry Minute wrote: Split(".".ToCharArray()
Your memory is exaggerating the method's complexity. The method accepts a char[] but since the parameter is defined with the params keyword a simple Split('.') would suffice.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|