|
It can but you get the security message so it isn't suitable.
Thanks though,
_Goose
-- modified at 8:35 Friday 14th April, 2006
|
|
|
|
|
_Goose wrote: It can but you get the security message so it isn't suitable.
Is that the same security message that pops up when an email is sent trough Outlook via code? If yes, then if the original Application object from Onconnection is used, the Security popup doesn't pop up.....
Hope this helps....
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
Really? I must try that then, thanks.
_Goose
|
|
|
|
|
can anyone tell me some way to set different colors for different Items that I add to my listbox? I am inserting strings into a listbox, but I want them to appear in different colors, how can I do that?
|
|
|
|
|
|
Is there any Hash Table in C# and if yes then how do we use it? How do we add and how do we look up in hash table?
|
|
|
|
|
Yes, class Hashtable
<br />
Hashtable hash = new HashTable();<br />
hash["key"] = 0;<br />
MessageBox.Show(hash["key"].ToString());<br />
You can also access data through properties "Keys" and "Values".
Best regards, Alexey.
|
|
|
|
|
Hi,
yes of course, by using the "Hashtable" class.
Hashtable myHashTable = new Hashtable(); to instantiate a Hashtable object.
myHashTable.Add("theKey", "theValue"); to add an element
myHashTable["theKey"]...; to retrieve a "value" usig its "key"
myHashTable.Keys; to retrieve the Keys Collection property
and myHashTable.Values; to retrieve the Values Collection property
Regards.
-- modified at 5:03 Friday 14th April, 2006
|
|
|
|
|
By the way, you can look up the hashtable by
Hashtable.Contains()
Hashtable.ContainsKey()
Hashtable.ContainsValue
as well.
|
|
|
|
|
|
Hi One & All
This is Naren, I m very new to this environment of .net.
I need some help to create a Dynamic slide menu using database in asp.net web application with c# coding.
So kindly pls give me the suggestions that how to create.
Thanking u ,
Naren
please help me
|
|
|
|
|
|
I write a application client/server (windows form). Both client & server run in a Active Directory domain. When client connect to server, server will get IP of client. Base on IP, server check current user logon in client PC, determines if the user has been authenticated by Windows.
At client, I can use System.Security.Principal.WindowsIdentity.GetCurrent() to authenticate user but at server, I don't know way authenticate remote user.
In case, what is solution? System.DirectoryService?
conglt
|
|
|
|
|
Ummm, there's no need to check to see if Windows authenticated the person or not. If the authentication failed, that person would not be logged onto Windows, and therefore, there won't be a user logged on.
All you really need to do is on the client side, pass the clients WindowsIdentity (use GetCurrent), to the server. The server will then have everything it needs to know about the user.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I happened to find that in the provided libs of my program, many thread are invoked just by BeginInvoke without callback to do EndInvoke. Waht will happen to a thread in ThreadPool if EndInvoke is not all at all?
Asyncs threads invoked by BeingInvoke are used in my program to send event, many I often enfront the problem that some events seem to heave disappeared in the middle of that thread.
I will add EndInvoke code to all these threads. But I hope that I can get some confirmation befrore doing that.
Thank you !
|
|
|
|
|
As I understand it, EndInvoke() is used to obtain the return value of your delegate method. If your delegate method is of type void , a call to EndInvoke() may not be required. if you haven't already, see this[^] article.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Thank you very much.
But I was told that BeginInvoke and EndInvoke should be called in pair, otherwise memory leak may happen in program.
I have checked topics on ThreadPool the other day, and I found that threads invoked by BeginInvoke are not so simple.
|
|
|
|
|
Bob_Sun wrote: BeginInvoke and EndInvoke should be called in pair,
Hmm, I don't believe that is correct (but could be wrong). See this[^] MSDN article.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Of cause, I haven't found any such discription in MSDN articles, just on some forum. But the fact is that my program do stop at somethere in the invoked thread (maybe for some other reasons).
As the detail of ThreadPool is not opened completely, now I am considering of writing a ThreadManager of my own, just start a thread by Thread.Start(), if necessary cancel it by Thread.Abort().
|
|
|
|
|
|
Rest assured. EndInvoke is ONLYused if your asyncronous method returns something. You call EndInvoke to retrieve that return value, since you can't get the return value in any other way. EndInvoke does not do anything else apart from giving you the return value. If you are not interested in the return value, you do not need to call EndInvoke. I have used BeginInvoke so many times in so many performance critical applications without using EndInvoke, it doesn't create a problem
|
|
|
|
|
Tehnoon wrote: I have used BeginInvoke so many times in so many performance critical applications without using EndInvoke, it doesn't create a problem
Thank you for quick reply.
In my case, this is the opposite, it seems to me that the thread invoked by BeginInvoke disappeared half way(only part of the log left). I am not sure whether a background thread will disappear half way if GC.Collect() happens during its process? I am investigating for the reason...
Thank you
|
|
|
|
|
delegate.BeginInvoke (creates new thread [from thread-pool]) without delegate.EndInvoke will cause a memory leak.
Control.BeginInvoke ('sends' call to main thread) without Control.EndInvoke is no problem.
|
|
|
|
|
Daniel Grunwald wrote: delegate.BeginInvoke (creates new thread [from thread-pool]) without delegate.EndInvoke will cause a memory leak.
I am troubled by threads invoked from ThreadPool.
Can you give me some hint about what the memory leak will bring about?
Thank you.
|
|
|
|
|
I think you will leak one WaitHandle for each delegate.BeginInvoke call, plus any objects waiting to be returned (e.g. exceptions). When you want to use the thread-pool in "fire-and-forget" mode, use hreadPool.QueueUserWorkItem or provide a callback-method to delegate.BeginInvoke that in turn calls delegate.EndInvoke.
|
|
|
|