|
Christian Graus wrote: You're creating a new class instance, they don't create themselves
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Christian Graus wrote: You're creating a new class instance, they don't create themselves.
That's why this C# fad will never last.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I had the same question here with no positive answers and did a lot of reading finding the answer in Delegates and Event handling - do a search in the articles in Delegates and Event handling. It ends up a long and tedious process of three pages of coding to fix. I got fed up and just posted the variables as public static and then everything can see it allways. Very crude and non conforming to OOP, but quick !!
cheers
Ian
|
|
|
|
|
I have MDI Form with background image in c#.
MDI Form Contains controls like button ,splitter etc.
When form repainted it flickers each time. how to avoid flickering of controls.
|
|
|
|
|
turn on double buffering. SetStyle is what you need to call.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi all
as is known to all,the char '<','>','&' is XML format.
but when i want to write a string that contain a '<' or '>' or '&'
in a XML,i could replace it such as :
<code>
string XMLstring = x[y].ToString();
XMLstring = XMLstring.Trim();
XMLstring = XMLstring.Replace("&", "&");
XMLstring = XMLstring.Replace(">", ">");
XMLstring = XMLstring.Replace("<", "<");
excelDoc.Write("<Cell ss:StyleID=\"StringLiteral\">" +
"<Data ss:Type=\"String\">");
excelDoc.Write(XMLstring);
</code>
but i failed :
<code>excelDoc.Write("<Cell ss:StyleID=\"BoldColumn\"><Data ss:Type=\"String\">");</code>
what should i do ?
Thanks!
|
|
|
|
|
That's not a good idea. Put the text in a CDATA[^] section.
|
|
|
|
|
If excelDoc is an XmlDocument it'll handle all that for you.
|
|
|
|
|
|
Hello everyone,
If I have enough priveleges, how could I get and access the services on a remote computer if I know the remote computer machine name? For example, I want to enumerate all the services on a remote computer and stop a service if its name matches some rules?
thanks in advance,
George
|
|
|
|
|
Process.GetProcesses(machineName)[^] gives a list of processes running on the specified machine. For authenticating remote machine, I think you should impersonate the user as Process.GetProcesses is not allowing to supply any user credentials.
|
|
|
|
|
What means "impersonate the user as Process.GetProcesses is not allowing to supply any user credentials."? I read a couple of times but do not know what you mean. Could you say in some other words please?
regards,
George
|
|
|
|
|
Process.GetProcesses is not allowing to supply user credentials for the remote machine. So you need to use some impersonation techniques to authenticate the remote machine. I haven't used but I think WindowsImpersonationContext[^] class can be used for this.
|
|
|
|
|
Thanks N a v a n e e t h!
I read the link but confused about what means "impersonation operation" or so-called impersonation technologies, does it a hacking technologies which someone acts (pretents) to be someone else? Could you clarify or provide some reference document about this technique please?
regards,
George
|
|
|
|
|
|
Cool, Uros!
regards,
George
|
|
|
|
|
|
Thanks Tom,
The link your provided is very helpful. After reading it, I am confused about what means "This would be useful, because the Service Control Manager (SCM) Microsoft Management Console snap-in does not support custom commands." -- custom commands means? Could you show me an example please?
regards,
George
|
|
|
|
|
Hi friends
How to use a common source class (.cs) file in different project files without copying into project's folder.
thanks in advance
-RisKhan-
|
|
|
|
|
What a bout compling the class to DLL
and the add it to the ref
Have Fun
Never forget it
|
|
|
|
|
Hello,
You have to think Classes not file.
The best solution is to create a Class libraby project (DLL) that contains your classes
Then if you want to use it, you reference it in your current project.
That's it !
|
|
|
|
|
i think above solutions are good
thanks
-RisKhan-
|
|
|
|
|
Add the file as a 'Link', you get this by clicking the little down arrow on the 'Add' button.
|
|
|
|
|
In my Application i want to Hide Cursor. i want to disable right click,..left click menu strip all.
I try with
Cursor.Show();
ShowCursor(1);
[DllImport("user32")]
public static extern int ShowCursor(int bShow);
but it is not success.Also i need to enable the mouse in one page. i have an internet page also in my application i want to enable the cursor in that page.
So what is the best solution for my application?
|
|
|
|
|
Cursor.Hide();
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|