|
i want search word in particular web address,so i want to use UltimateSearchInput button,but i didnot know how to use. if u know the code replay to me...
|
|
|
|
|
Hello everyone,
From the sample,
http://www.albahari.com/threading/part2.html
Do you know what means "A thread can block only on the first, or outermost lock."?
I quote the related context below as well.
--------------------
Nested Locking
A thread can repeatedly lock the same object, either via multiple calls to Monitor.Enter, or via nested lock statements. The object is then unlocked when a corresponding number of Monitor.Exit statements have executed, or the outermost lock statement has exited. This allows for the most natural semantics when one method calls another as follows:
static object x = new object();
static void Main() {
lock (x) {
Console.WriteLine ("I have the lock");
Nest();
Console.WriteLine ("I still have the lock");
}
Here the lock is released.
}
static void Nest() {
lock (x) {
...
}
Released the lock? Not quite!
}
A thread can block only on the first, or outermost lock.
--------------------
thanks in advance,
George
|
|
|
|
|
George_George wrote: Do you know what means "A thread can block only on the first, or outermost lock."?
It means that when it encounters the first lock (or outermost lock) the thread blocks others from accessing the object that is locked.
An individual thread can lock an object as many times as it likes, but it only locks on the first occurrence.
|
|
|
|
|
Thanks Colin,
Two more comments,
1.
Colin Angus Mackay wrote: It means that when it encounters the first lock (or outermost lock) the thread blocks others from accessing the object that is locked.
Even if the thread can not acquire the outermost lock, it will block other thread from accessing the lock object to try to lock?
2.
Colin Angus Mackay wrote: An individual thread can lock an object as many times as it likes, but it only locks on the first occurrence.
It is a typo, "only locks on the first occurrence" should be "only blocks on the first occurrence"?
regards,
George
|
|
|
|
|
George_George wrote: Even if the thread can not acquire the outermost lock, it will block other thread from accessing the lock object to try to lock?
It hast to aquire the lock first. If it can't aquire the lock, it can't block.
George_George wrote: It is a typo
Yes. You are correct.
|
|
|
|
|
Thanks Colin,
Question answered. Cool!!
regards,
George
|
|
|
|
|
Hi
How to Install and Configure CRM 3.0 SDK Problem in Vs.Net 2003 ?
please give me an article that explain perfectly.
thanks
|
|
|
|
|
Try here[^].
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
thanks for reply
i tried your suggestion, but i don't found any useful topic with match with my aim in this link[^]
can anyBody help me ?
|
|
|
|
|
Hi
how to pass textbox value from one form to other form in window application
+c# .If any one knows this help me with code i'm new to window application
Thanks and regards
suman
|
|
|
|
|
Lots of different ways, but you could expose a property on one of the forms like:
public string TheValue
{
get { return theTextBox.Text; }
set { theTextBox.Text = value; }
}
Your other form can set TheValue using code like chee:
form2.TheValue = "stuff";
form2 would be an instance of your "other form" which has already been created, of course.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
You can also pass it to a session variable and u can retrive the values in the form u needed.
|
|
|
|
|
You're very confused. Forms apps do not have session variables.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
http://www.codeproject.com/KB/dotnet/passingvaluesbetweenforms.aspx[^]
Searching the site is often a good idea.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
very very easy
there is 2 ways pass the value one form to a nother forms.
1.Properties
2.Constructor params
In my point of 2ndis good because of when make cons we , just create overload cons and pass the varible to that.
variable is textbox value
|
|
|
|
|
Hello.
I am developing a program where I have some textboxes and forward and previous buttons.
I also have a txt file. I want to read from my txt file and then write to my textbox.
My txt file looks like this:
19 1 "Yeti" 30 900 0 105 110 37 0 150 37 2 17 4 6 400 2000 10 2 180 14 6 0 0 3 0 0<br />
20 1 "Elite Yeti" 36 1200 0 120 125 50 0 180 43 3 0 1 6 400 1400 10 2 180 14 6 0 1 4 1 1<br />
21 1 "Assassin" 26 800 0 95 100 33 0 130 33 2 0 1 7 400 2000 10 2 180 14 6 0 0 0 0 0<br />
22 1 "Ice Monster" 22 650 0 80 85 27 0 110 27 2 7 1 5 400 2000 10 2 170 14 6 0 0 3 0 0<br />
23 1 "Hommerd" 24 700 0 85 90 29 0 120 29 3 0 1 5 400 1600 10 2 170 14 6 0 0 3 0 0<br />
24 1 "Worm" 20 600 0 75 80 25 0 100 25 3 0 1 4 400 1600 10 2 160 14 6 0 0 2 0 0<br />
25 1 "Ice Queen" 52 4000 0 155 165 90 0 260 76 3 11 4 7 400 1400 50 2 180 14 3 0 4 5 4 4
I want it to read one line and then for example set Yeti and 19 into a textbox
When you push forward it reads elite yeti and 20
But I don't know how to do
I am assuming I need space as a separator and then use like var[3] where 3 is the third word.
A little like in mirc where you can write
$gettok(one two three, 32, 3) where it picks the 3 word with the separator space (32)
But when it gets to the code and not the idea im kinda stuck. Any ideas?
Im using Visual C# 2008 Express Edition
|
|
|
|
|
the split method on the string class would usually do it, but because you have spaces in words, you need to either use split them rejoin based on quotes, or write your own parser.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have been ripping my hair out because I cant find a solution.
I got it all working, but now I must format more text
I got a new text that has sections like this:
<br />
1<br />
0 33 10 85 162 95 168 -1 5
1 29 30 40 113 45 116 -1 3
2 41 5 126 160 125 161 -1 2
3 38 5 106 161 111 160 -1 2
4 38 5 106 161 111 160 -1 2
6 38 5 106 161 111 160 -1 2
7 38 5 106 161 111 160 -1 2
14 38 5 106 161 111 160 -1 2
end<br />
0<br />
275 33 10 85 162 95 168 -1 5
275 29 30 40 113 45 116 -1 3
275 41 5 126 160 125 161 -1 2
275 38 5 106 161 111 160 -1 2
end
Now I changed my script so it reads the values from this script, and I changed the forward button so it jumps into new sections
But I just cant seem to figure out how to jump back to a section
This is the code that I use to go foward into a section:
if (pieces[0] == "end")<br />
{<br />
curRec += 2;<br />
displayLine(curRec);<br />
}<br />
else<br />
{
Here is all my code:
public void displayLine(int linenumber)<br />
{<br />
if ((linenumber >= 0) && (linenumber < lines.Count))<br />
{<br />
<br />
String line = (String)lines[linenumber];<br />
<br />
String[] pieces = line.Split('\t');<br />
<br />
if (pieces[0] == "end")<br />
{<br />
curRec += 2;<br />
displayLine(curRec);<br />
}<br />
else<br />
{<br />
txtID.Text = pieces[0];<br />
txtMap.Text = pieces[1];<br />
txtMoving.Text = pieces[2];<br />
txtXStart.Text = pieces[3];<br />
txtYStart.Text = pieces[4];<br />
txtXEnd.Text = pieces[5];<br />
txtYEnd.Text = pieces[6];<br />
txtDirection.Text = pieces[7];<br />
txtCount.Text = pieces[8];<br />
txtComment.Text = pieces[9];<br />
mobImage.ImageLocation = "D:/images/" + pieces[0] + ".jpg";<br />
}<br />
}<br />
<br />
}<br />
<br />
ArrayList lines = new ArrayList(100);<br />
<br />
int curRec = 0;<br />
<br />
public void Form1_Load(object sender, EventArgs e)<br />
{<br />
StreamReader f = new StreamReader(new FileStream(@"D:\monstersetbase.txt", FileMode.Open));<br />
<br />
String curLine;<br />
<br />
while ((curLine = f.ReadLine()) != null)<br />
{<br />
lines.Add(curLine);<br />
}<br />
<br />
f.Close();<br />
<br />
curRec += 1;<br />
<br />
displayLine(curRec);<br />
}<br />
<br />
private void nxtButton_Click_1(object sender, EventArgs e)<br />
{<br />
if (curRec < lines.Count - 1)<br />
{<br />
curRec += 1;<br />
displayLine(curRec);<br />
prvButton.Enabled = true;<br />
}<br />
}<br />
<br />
private void prvButton_Click_1(object sender, EventArgs e)<br />
{<br />
if (curRec == 2)<br />
{<br />
prvButton.Enabled = false;<br />
}<br />
if (curRec > 0)<br />
{<br />
curRec -= 1;<br />
displayLine(curRec);<br />
}<br />
}
|
|
|
|
|
|
Good Day,
I have a question about C# Express regarding it's legality for commercial use.
My family is running a small business and is need of a Sales and Inventory system which I can provide. I'm planning to use both C# express and MS SQL Express for developing the said system.
Is it legal to use it as such? Or it is limited for "educational" purposes only.
Thanks!
|
|
|
|
|
A) I think it's OK
B) Even if you weren't allowed to use C# Express to produce commercial apps you could still compile with the command-line C# compiler.
C) I installed SQL Server Express on the HR Director's computer and Microsoft hasn't come around and kicked in the door (yet).
|
|
|
|
|
Bill won't come kicking your door. I found this on their FAQ Site.
4. Can I use Express Editions for commercial use?<br />
Yes, there are no licensing restrictions for applications built using the Express Editions.
Check it out here http://msdn2.microsoft.com/en-us/express/aa718399.aspx[^]
|
|
|
|
|
Both are fine. They were released to compete with other totally free products and to provide a path to the full versions where needed. But, there is no limit on their use.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
As the others have said, you can use both for commercial use. Have done so for a few clients and all has been good.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I have an application written in C# , and I want the users to run it from the server ( windows 2003 ) without having that application installed on each and every machine using it , Just from the server . So the user has to log to the server only to be able to run it this application .
is that possible , any Ideas how to do it ?
Regards
Dean
|
|
|
|