|
where can i DownLoad something from our Website?
i can't find it?
for exeample :softeware,Tutorial
modified on Monday, December 7, 2009 11:32 PM
|
|
|
|
|
What?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
You mean from CP?
There are lots and lots of articles here. Search what you want. Read them and download source if present.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
It depends on the website. If you're talking about CodeProject, then there's usually a link at the top of each edited article.
|
|
|
|
|
Now i'm studing to do report,but no good books about CryStal Report tolearn,as a beginner,teacher ask me do my report work,because of limited time,please give me the Tutorial,or video Tutorial,thanks everyone!!
|
|
|
|
|
|
Ok so I am having a big problem with this. I had a problem with getting a remote servers serices to stop with WMI and ended up using a ServiceController instead (worked great).
I created a application that got all computer objects from AD. When you click on those computer objects it gets information such as services (and their state), installed applications, disk drives, and other information such a manufacturer, model, etc.. All of this works perfect!
The problem is I can't uninstall software. If I use the same credentials as I do getting the information I get an 'Access Denied' Error
ConnectionOptions conn = new ConnectionOptions();
conn.Impersonation = ImpersonationLevel.Impersonate;
conn.EnablePrivileges = true;
But if I do this I no longer get the access denied error and get the RPC server is unavailable:
ConnectionOptions conn = new ConnectionOptions();
conn.Authentication = AuthenticationLevel.Default;
conn.Impersonation = ImpersonationLevel.Impersonate;
conn.Username = "DOMAIN\USERNAME";
conn.Password = "PASSWORD";
conn.Authority = null;
conn.EnablePrivileges = true;
So how come I no longer get the access denied error and get something abouit the RPC server is not avaiable? How is this since the RPC service IS available since I just got tons of information from it!
Also if you are suggesting I try this instead of DOMAIN\USERNAME:
conn.Authority = "ntlmdomain:DOMAIN";
it doesn't work. When I do it that way it still gives me a access denied error.
I noticed someone else seemed to have this issue:
http://www.codeproject.com/Messages/2903205/WMI.aspx[^] but it was never resolved it looks like.
I have googled the crap out of this error message and tried everything that I found suggested (changing the AuthenticationLevel, changing the ImpersonationLevel) and it didn't work for me
|
|
|
|
|
Here is the code for uninstalling:
ManagementScope scope = new ManagementScope(@"\\" + software.DNS + @"\root\CIMV2", conn);
scope.Connect();
ManagementObjectSearcher mos = new ManagementObjectSearcher(scope, new ObjectQuery("SELECT * FROM Win32_Product WHERE Name='" + software.NAME + "'"));
foreach (ManagementObject mo in mos.Get())
{
ManagementOperationObserver observer = new ManagementOperationObserver();
observer.Progress += new ProgressEventHandler(observer_Progress);
observer.Completed += new CompletedEventHandler(observer_Completed);
mo.InvokeMethod(observer, "Uninstall", null);
}
Also I have tried this with my local machine and it worked great! Its the remote machines that are a problem. I have tried XP, Windows Server 2008 & 2003. Cannot get any to work.. Also I have tried it with the domain administrator account and local servers account (no luck).
|
|
|
|
|
Oh and in case your wondering.. I ran wmic on my local computer as me and everything worked great. There is something in the code that is not functioning correctly.
|
|
|
|
|
I know I am posting like a madman around here but I just figured out why it failed.. not how to fix it though.. When using the ManagementOperationObserver it fails. I had this coded to report the progress of the uninstall. If I choose not to use the ManagementOperationObserver it works perfect but without any detail if it completed, progress or anything.
So the cause of it failing is the ManagementOperationObserver... but why? This piece doesn't ask for any username or password
** EDIT:
I've read some more and think it has something to do with Partially Trusted Code? I am still lost.. can't really figure out why ManagementOperationObserver only works with working with your local computer and not remote computers
modified on Tuesday, December 8, 2009 7:15 PM
|
|
|
|
|
Hi,
I have a datagridview with a combobox.
to find out when the combobox have changed values i included the following code
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
ComboBox cbo = e.Control as ComboBox;
if (cbo != null)
{
cbo.SelectionChangeCommitted += new EventHandler(cbo_SelectionChangeCommitted);
}
}
private void cbo_SelectionChangeCommitted(object sender, EventArgs e)
{
MessageBox.Show(((ComboBox)sender).Text.ToString());
}
But the problem for me is that I realised that the messagebox gets triggered once for the first time i change a value in a row. But the second time i change value it gets triggered twice, third time it gets triggered trice and so furth.
So, I was wondering if there is any way to only trigger the SelectionChangeCommitted once every time a user changes the combobox value?
It will be a rather large number of rows, and if a user updates 200 rows, then it will mean that SelectionChangeCommitted will be triggered 200 times at the end and I can't have that as the messagebox should be replaced with a webservice that will update a value in a database at runtime.
Any suggestion would be appreciated.
|
|
|
|
|
Everytime the dataGridView1_EditingControlShowing method gets called you are adding a new entry to the delegate's (cbo.SelectionChangeCommitted ) invocation list with ... += ...
You should either move the event subscription to somewhere else that only gets called once, unsubscribe using ... -= ... , or keep a bool flag (array or list of bools if more than one control) and check it before the subscription - if false, set to true and subscribe; if true skip subscription.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Man.... Your right.
Thanks, had been staring myself blind at what I already knew.
Cheers,
Ronni
|
|
|
|
|
It looks like each time you show the editor you are running this line:
cbo.SelectionChangeCommitted += new EventHandler(cbo_SelectionChangeCommitted);
Since += is used the events are additive.
I assume the grid has an event for the editor closing? Sorry I use DevX controls and don't really know the MS grid.
Find the editor close event and run this line:
cbo.SelectionChangeCommitted -= new EventHandler(cbo_SelectionChangeCommitted);
This will remove the event that is showing the message box.
Opening the editor attaches the message box event, closing the editor releases it.
|
|
|
|
|
1 . What is the best way to set communication between 2 processes on the same computer? (The simplest way because every process will be writen by another company and team).
2. Is there a way that 2 processes will be in Contact through DLL (class with static values, Static function and so on) ?
Thanks ,
Shai.
|
|
|
|
|
bonzaiholding wrote: communication between 2
We use named pipes for our application which has worked out pretty well for us.
bonzaiholding wrote: Is there a way that 2 processes will be in Contact through DLL
I guess I don't understand what you are asking here. But is sounds like you are asking that the two process have to have a common reference to the same data structures. So yes you would have to have both projects use the same data structures.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
Wes Aday wrote: named pipes
That sounds right.
Wes Aday wrote: have both projects use the same data structures.
That's not real easy; each app has its own app domain.
|
|
|
|
|
what is the best car?
do you need signaling? are you looking for something message oriented? or just shared data?
do you need locks? etc etc.
You need to provide more information as to the kind of data and communication you're intending.
|
|
|
|
|
I don't need a lock, i need data,structure and most important is signaling.
|
|
|
|
|
that does not tell me anything about the app and the data, so the best I can say is:
- sharing data can be done with a memory mapped file, this probably needs P/Invoke and Win32 API;
- signaling can be done in many ways, e.g. with Windows messages (override WndProc)
alternatives are:
- sending messages (data+signal), e.g. with named pipes
- RPC
- remoting
- ...
|
|
|
|
|
One way to setup interprocess queue using a reliable queueing mechanism would be to use MSMQ.
Here is a good sample - http://articles.techrepublic.com.com/5100-10878_11-6170794.html[^].
I have never used MSMQ for interprocess communication myself, so I cannot help you further with this.
modified on Tuesday, December 8, 2009 12:00 AM
|
|
|
|
|
I'm not even sure if this is possible, or what to even google for, so I'm looking for suggestions.
What I want to have is a directory full of .net dlls, that all do different things, but have the same public function as an entry point.
I don't want to have to reference each dll, so is there a way to hook up to the dll and use the public function that I know will be the same for each dll file?
Thanks,
Tim
|
|
|
|
|
Try like the following,
<pre> private const string Kernel32Dll = "kernel32.dll";
private sealed class SafeLibraryHandle : SafeHandleZeroOrMinusOneIsInvalid
{
public SafeLibraryHandle() : base(true) { }
[SuppressUnmanagedCodeSecurity]
[DllImport(Kernel32Dll)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool FreeLibrary(IntPtr hModule);
/// <summary>Release library handle</summary>
/// <returns>true if the handle was released</returns>
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
protected override bool ReleaseHandle()
{
return FreeLibrary(handle);
}
}
</pre>
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
|
I agree with you.
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|