|
It's probably not obvious that this thread was originally posted in the lounge, and got moved here (somewhat unnervingly!) - that's why it got the sarcastic replies
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
You're right! I had no idea it was in the Lounge before comming here..
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello everyone, Im trying to get my program to wait with other tasks while it completes a task. Thread.Sleep(); did not work, instead the whole program "slept". Ive looked for threading example on the net and have found only complicated one dealing with servers and things but I just need the simplest example anyone can spit out. Ive tried also putting the tasks seperately and then defining threads for them, then when the user presses the button it is supposed to executes all the threads in the right order, I also set the priority for each thread. so far no luck and it seems like whenever I use Thread.Sleep(), thats one of the first things the app does while it should be one of the last. Im not sure exactly what to do at this point.
|
|
|
|
|
When you spawn multiple threads, you do so for concurrent computation. You should not spawn nine threads and then try to have them execute sequentially; this defeats the purpose of threads.
Why don't you spawn one thread with a callback method, have it do its work, then it will call your specified method and you can continue with what needs to get done?
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Well at the moment the project has 2-3 main objectives. One is to automatically fill out information in an application, ie. name, address, phone number, etc., then save the information. after saving the info it should close the application window. Since this window isnt apart of my project Im using API and SendKeys, but the problem is that my project closes the application window BEFORE the information gets filled out. If I dont try to close the window automatically, then the info gets filled out fine, so it seems that the API and SendKeys is either a bit "slow" or my project is just executing the command to close the window first. I dont think its as complicated as with 9 threads, but Ill see if I can find out about a callback method. This is my first time using threads.
|
|
|
|
|
Hi I wrote a SOAP-Client in C#.
To Execute SOAP-Requests is very easy by adding the web reference of the service.
But how can I access the SOAP-Messages e.G when I want to change the header or handle the attachment of SOAP-Responsemessages.
Florian
|
|
|
|
|
You could use SOAP extensions. You will have to work out the details yourself, but it is fairly well-documented in MSDN library.
As a starter: SoapExtension class[^]
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
-- modified at 9:12 Friday 17th February, 2006
|
|
|
|
|
Hi thanks,
I wrote my SOAP Extension class.
But what I not found is how I can use this class in combination with the web reference classes.
Can someone tell me this?
Florian
|
|
|
|
|
How To Rotate the Images by using JavaScript
Balu
|
|
|
|
|
I want the property grid to be dockable as well as floating just like VS property grid for editing the properties of the controls.I got a reply on some forum to add the property grid to the toolstrip but i cant find any way to do that...is there any way to add the property grid to the toolstrip???? or is there any other way to make the property grid dockable and floating???
|
|
|
|
|
|
How do I get from a Class Library DLL the Assembly of the project that is using my DLL ?
|
|
|
|
|
Assembly.GetCallingAssembly(). Make sure you call it from a method that is never called from inside your DLL.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
thanks. but I have another problem.
Project1 is using DLL1. DLL2 is using DLL2
how can DLL2 get the Assembly of Project1 ?
when DLL2 users Assembly.GetCallingAssembly() it gets the Assembly of DLL1. is there a way for it to get the Assembly of Project1 ?
Thanks.
|
|
|
|
|
There is also the Assembly.GetEntryAssembly() method.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
I am interested in a way, using the .NET Framework classes, to obtain a MAC address based on an IP number. Knowing an IP number, I need to know to extrapolate the MAC address. How can this be done with the .NET Framework and C#? I know that the MAC is not in the Request object, I need some guidance on getting the MAC *after* I have used the Request object to get the IP number. I have found some about using the "System.Management" Namespace already.
I'm assuming the machine running the function and the remote machine we are trying to obtain the physical address of are on the same network segment and are not separated by a firewall.
Any thoughts about a solution to the problem?
|
|
|
|
|
I don't think you can have the MAC address of a remote machine, at least not outside your network. This information is part of the physical transport layer, and is valid only with ethernet interfaces.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
As i wrote..
I'm assuming the machine running the function and the remote machine we are trying to obtain the physical address of are on the same network segment and are not separated by a firewall.
|
|
|
|
|
|
While ARP may be used to obtain the MAC address, a solution with the existing program arp.exe that is included with windows is not directly what I had in mind..
|
|
|
|
|
So what did you have in mind that my answer above didnt point you in the right direction for?
1) Get name of compuiter connecting to me using HTTP Request
2) Get MAC address of computer name from 1) using a method found on google
|
|
|
|
|
Hi all ..
I'm printing some images through PrintDocument.
I need to get the height in millimeters or centimeters before I send it to document. Is there any way of doing this? I have searched through graphics namesspace and only found ways om doing string measurements.
Pleae help
Regards // H
-- modified at 5:34 Friday 17th February, 2006
|
|
|
|
|
Hi,
I have a problem with my MySqlConnection in one of my programs.
When using the MySqlConnection object.
My 'system':
.Net 2.0
MySql 5.018
.NET Connector 1.07
Connection string: server=XXX.XXX.XX.XXX;database=XXX;user id=XXXX;pwd=XXXX; allow zero datetime=true; Protocol=TCP; Compress=false; Pooling=true; Min Pool Size=1; Max Pool Size=300; Connection Lifetime=0"
Everything works nicely a couple of times when I open the connection and do my queries (and close the connection).
But after (about the third time) the connection throws an exception when I try to open it:
Error:
System.ObjectDisposedException was unhandled
Message="Safe handle has been closed"
Source="System"
ObjectName=""
StackTrace:
at System.Net.UnsafeNclNativeMethods.OSSOCK.shutdown(SafeCloseSocket socketHandle, Int32 how)
at System.Net.Sockets.Socket.Shutdown(SocketShutdown how)
at ᐂ.Finalize()
Has anyone experienced this problem?
/// regards Patrik
|
|
|
|
|
Before typing to open your connection, check its .IsDisposed property. I suggest that under certain circumstances your code is disposing a connection and then trying to reuse it. This might be a race condition against a connection object, or it might be you trying to re-invent connection pooling - either of these sound possible?
|
|
|
|
|
Hi,
Thanks for the help!
I checked my code and I don't dispose the object. (I actually didn't find any .IsDisposed property for the connection object).
The code works really good for a number of tries and then suddenly it throws an exception. The error occurs very randomly.
"This might be a race condition against a connection object, or it might be you trying to re-invent connection pooling" - How can I check these issues?
I don't use any threads but I open and close the connection with the following code.
public static MySqlConnection Open()
{
try
{
MySqlConnection conn = new MySqlConnection(ConfigurationManager.AppSettings["MySqlConnectionString"].ToString());
conn.Open();
return conn;
}catch(Exception e){
string error = e.Message.ToString();
return null;
}
}
public static bool Close(MySqlConnection conn)
{
if (conn.State == System.Data.ConnectionState.Open)
{
try
{
conn.Close();
}
catch (Exception e)
{
string error = e.Message.ToString();
return false;
}
}
return true;
}
|
|
|
|