|
I don't use ASP, some of the othe guys here may be able to help more but a quick google search[^] for 'multithreading inside a web service' turned up a plethora of promising results.
Dave
|
|
|
|
|
When I clicked on you link, the 3rd item is your reply.
|
|
|
|
|
Le Centriste wrote: When I contact the web service http://localhost/blabla/blabla.asmx with IE and select teh web method that calls the library method which in turn starts the worker thread, the page blocks until the background thread is finished.
Strange. Do you have any waithandles waiting for signal ? Can you post some sample code ?
AFAIK, each web method in a web service offer an asynchronous fashioned method. If you have a web method say "Foo", you will also have "FooAsync" which returns immediately and does the job on another thread. Please try that.
|
|
|
|
|
Le Centriste wrote: When I contact the web service http://localhost/blabla/blabla.asmx with IE and select teh web method that calls the library method which in turn starts the worker thread, the page blocks until the background thread is finished.
That sounds right. Or are you expecting the page to return, then when the worker is finished, a magical AJAX call will notify you?
|
|
|
|
|
I provide another method that you can call to know the progress of the task started.
|
|
|
|
|
I have seen some codes as are shown bleow, although they works fine but i am asked to use equal() function with strings. What's the difference then.
string str="aa";
if(str=="aa")
{
}
|
|
|
|
|
I think Equals function compares the reference not the value itself.
|
|
|
|
|
No.
From Object Browser...
Determines whether this instance of System.String and a specified object, which must also be a System.String object, have the same value.
Dave
|
|
|
|
|
If you use Equals() you can specify the culture (your own, a preset or none at all) used for the string comparison.
You can also compare with an object. Consider this example:
ListBox listBox = new ListBox();
listBox.Items.Add("a");
string x = "a";
Console.WriteLine(x.Equals(listBox.Items[0]));
Dave
|
|
|
|
|
netJP12L wrote: string str="aa";
if(str=="aa")
{
}
This is equal to
string str="aa";
if(str.Equals("aa")){
} When you use str == "aa" , string class calls the Equals() method to do the comparison. Only advantage I can see if you use Equals explicitly is supplying the StringComparison enum.
I prefer to use string.Compare to compare strings.
|
|
|
|
|
All,
I am attempting to write a new Remote Registry key Value string, but I keep receiving a "Cannot write to the registry key" exception. I have full access to the remote key and have set that access (as an extra measure) inside my program. Below is the code I an attempting to use. I can read the value fine, but cannot edit it.
Thoughts?
bool SetRegKey(String hostname, String strPrimaryUserGroup)<br />
{<br />
String strBaseKey = "Software\\Agent";<br />
RegistryKey environmentKey = RegistryKey.OpenRemoteBaseKey(<br />
RegistryHive.LocalMachine, hostname).OpenSubKey(<br />
strBaseKey);<br />
String PUGValue = environmentKey.GetValue("PrimaryUserGroups").ToString();<br />
if (PUGValue != strPrimaryUserGroup)<br />
{<br />
environmentKey.SetValue("PrimaryUserGroups", strPrimaryUserGroup);<br />
}<br />
return false;<br />
}
|
|
|
|
|
Hi, I've been trying to get a list of module names of local processes on my box but I got access denied in the attempt. This issue happen with every high privileged process ie: smss, svchost, winlogon, ... I've tried google it but without success any hint on that ? Btw I'm using VS 2005 on Vista.
sh*t
|
|
|
|
|
Hello,
VS 2008
I have typed dataset and have added a single data table named dsMissedCalls.xsd and dtMissedCalls.
I would like to save some missed calls for my application. The table is very small not more than 10 rows.
Example. dtMissedCalls(ID, Caller, DateAndTime)
I have created a XML file, and I would like the xml file to have the schema of the typed dataset (dsMissedCalls.xsd).
Before when I have been creating xml file. I would add a new xml file. Then click the "Create Schema" button. That would creaet the schema for the xml file. However, as I have created a typed dataset that already has a schema. The question is. How do I get my xml file to relate to that schema?
So basically I have created a typed dataSet and would like to save added rows to the xml file.
The code below works, but I want to xml to use the dataset schema.
Many thanks for help with this confusing question,
<br />
DataRow row;<br />
row = ds.Tables[0].NewRow();<br />
row["Caller"] = callersName;<br />
row["DateTime"] = DateTime.Now.ToShortDateString();<br />
<br />
ds.Tables[0].Rows.Add(row);<br />
ds.WriteXml(missedCallsXML, XmlWriteMode.DiffGram);<br />
|
|
|
|
|
Hi,
I have used the picture box to draw an image on the screen. Its loading perfectly, now I want to draw over some parts of the image, with rectangles and lines.
I tried to draw on the picture box by doing the following but nothing shows up?
How can I go about doing this.
Graphics g = pictureBox1.CreateGraphics();
SolidBrush solidBrush = new SolidBrush(Color.Blue);
g.FillRectangle(solidBrush, 0, 0, 100, 100);
Any help would be greatly appreciated
|
|
|
|
|
You cannot simply draw a line or rectangle on top the image. They are drawn behind the image. You need to make them a control and set the foreground or background property.
|
|
|
|
|
"Graphics g = pictureBox1.CreateGraphics();"
That is a bad idea unless you're drawing something you want to erase, like a rubber band. Painting should take place in the paint event. And, at this point, you should just draw your bitmap in the paint event, then draw on it.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
I'm would to find out if anyone has an example of spying on another app like the Managed Spy[^] but being able to retrieve the selected row and/or the text in the various columns of that row. Is it possible in .NET 2.0?
I would especially appreciate an example of MFC C++ spying on .NET 2.0 code and being able to get the DataGridView text.
Thanks,
|
|
|
|
|
My project is written by C++, now I want to change it to .NET platform, I have two choices, C# or C++/CLI, choose C# means rewrite all of the code, choose C++/CLI means part rewrite, and it's flexible
But I'm warry about three points:
1.The grammar of C++/CLI is surprising, what is the C++/CLI like? C++? C#? a new language?
2.The flexibility of C++/CLI is interesting, but may not good to the project leader, if the programmer write some pure c++ code and cause some abnormal memory accessing, it's hard to find them out. Who can guarantee that his programmers are all good enough?
3.After change to C++/CLI, the workload of refactoring may not lower than rewriting
So, it seems that I should use C#? Who can give me some ideas? Thanks in advance
|
|
|
|
|
C# would be the better way to go. I was brought up with C++, went over to C# since I also worked with Java and there are similarities. When C++/CLI came about, I was too hooked on C#. Compare the number of posts in the C# forum here versus the C++/CLI forum...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
In my opinion you should try to stay away from c++/cli.
Either choose c++ or C# or like i do: Use C# for gui and stay with c++ for internal processing.
Learn from the mistakes of others, you may not live long enough to make them all yourself.
|
|
|
|
|
Yes, the WPF attacked me, I want to use it to the GUI. thanks for your advice
|
|
|
|
|
hello..
I have one form with datagrid on it. when i click the button on that form, it shows another form on which i made updating database using SQLCommand. When I turn to the first form, the datagrid isn't updated...It is updated only when I close application and start it again- then i see the changes..
I also have this line of code after I close the second form: DataGrid.Refresh()
What should I do?
|
|
|
|
|
Is it ok that i do this after i close the second form:
dataSet.Clear();
dataAdapter.Fill(dataSet);
then, it will work. But, is it ok this, because in the Load method on first form I already set dataSet and fill adapter? or it isn't matter at all?
|
|
|
|
|
hi all does anyone know how to convert the following js into c# ?
my_str += String.fromCharCode((src.charCodeAt(c) ^ keys[cc]));
which is contained in the following loop (for clarity):
for(var c:Number = 0; c < src.length; c ++){
if(cc>=i) {
cc = 0;
}
my_str += String.fromCharCode((src.charCodeAt(c) ^ keys[cc]));
cc++;
}
I've searched and found the equivalent for both but dont seem to be able to put it together, it should be something like this in c#:
my_str += new String(new char[]{(Int32)Data[c] ^ keys[cc]});
but that obviously fails and im just confusing myself now. any pointer very very much appreciated.
keys is already converted into an array of ASCII codes and Data is a string at present, i was thinking I should convert it into an array of ASCII codes as well.....
thank you
tim
|
|
|
|
|
ignore
was having one of those moments when you cant see the woods for the trees (or whatever!)
my_str += (char)(letters[c] ^ keys[cc]);
does the job after creating the letters array using (Int32)input[i] in a for loop
thanks
anyway.
t
|
|
|
|