|
hello
Process.Start("shutdown", "-s");
i use this code to turn off system but when this code executed one form same as main form is open.
please tell me where is problem?
shahin gholami
|
|
|
|
|
if I understood your problem then maybe I could tell you how to solve it
|
|
|
|
|
I want to turn off system by this code
Process.Start("shutdown", "-s");
but every time I run this code one new form appeared and my system don't turned off
I use VS 2008
please help me
shahin gholami
|
|
|
|
|
you need to explain your problem better (show more code around that part)...
I tell you what, if you can solve my problem below i'll concede that you have provided enough information for your problem...
PROBLEM:
Why does my application close every time I press a certain button to open a new form, here is my code..
void OnButtonClick(object sender, EventArgs e)
{
Form1 form1 = new Form1();
form1.Show();
}
... It shows the form then for some reason the application just closes itself.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I use this method:
private void btnShutDown_Click(object sender, EventArgs e)
{
string t = "-r -c \"I am going to reboot your mechine\" -t 20";
Process process = new Process();
process.StartInfo.FileName = "shutdown.exe ";
process.StartInfo.Arguments = "-l";
process.Start();
}
please run this code and see the result.
this code open a new form for me
shahin gholami
|
|
|
|
|
as musefan says.
how are you calling the code that calls the shutdown?
what is your program doing?
how is it opening the form?
|
|
|
|
|
|
Hi, I tried several ways to load the below format XML file.
Every time I was unsuccessful,
the error shown to me is:
The ':' character, hexadecimal value 0x3A, cannot be included in a name. Line 2, position 6.
System.Exception {System.Xml.XmlException}
I could get the problem where it occured. It is due to ':' in the second line.
But my file should be of that format only, where this couldnot be changed.
Please help me to load this file successfully and make my task functioning....
Thanks in advance....
Below is the XML file formatwhich was loaded by me:
*********************************
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="https://xyz.sdsdasas.com/CustomerDetails.xsl"?>
<Customer>
<CustomerDetails>
.....
....
...
</CustomerDetails>
</Customer>
**************************
|
|
|
|
|
hello,
I have window application with datagrids inside. Those datagrids take information from DB.
I have an option that the user could choose with columns from the DB he could see in the datagrid (using visible- true/false).
I want to add an option that the user could save those changes he made to the datagrids (add / remove columns) so those settings will be saved for the next time he will enter the application. How can i do it?
|
|
|
|
|
Have a look at the System.Configuration.ApplicationSettingsBase. If you want to store a list of columns for each grid, have a look at my article here[^].
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I didn't quite understood this.
Can you show me maybe code example how to do it? i mean for columns visible true/false
|
|
|
|
|
Does anyone know how to do it?
|
|
|
|
|
You can use the code in the article to create a List<bool> for each one and save the user's selection there.
When showing it, read the respective List and iterate over it, setting the respective column's visible state based on the result.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hi
I want Information about Printer which is active among all the printers that has installed on my System.
Steps:
1.open any link on Internet Explorer
2. select File -> Print and click.
A message box displayed
which shows to select a printer among various printers installed.
3. then clicks Print button.
I want to know the details of the Printer which had been selected for printing the page using c# ?
How can I?
If I want to cancel the printing action after giving to print, how can I cancel
|
|
|
|
|
I need to keep a logged in user's details and permissions kept in a globally accessible object.I know that c# doesn't allow you to store an object that is globally accessible but is it then better to just retrieve a users permissions and details again from the db instead of just passing a reference to every new form that I create? This object will be used to determine if a user can enter a sub-system of the application or just to change his password. Should I use MDI Forms perhaps? Any help would be greatly appreciated.
thanx in advance
modified on Tuesday, May 19, 2009 3:34 AM
|
|
|
|
|
Possibly use a static class?
E.g.
public static class UserDetails
{
public static string name;
public static string dob;
}
On start up the app could then do something like UserDetails.name = nameFromSomewhere
Elsewhere you could use e.g. if (UserDetails.name == "Fred")...
You would probably want to use properties rather than public fields.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
Simple, yet effective. Thanx. I kept on thinking that I'd have to instantiate an object for this purpose. I even considered running a new thread and just keep the details in an object referenced by that thread. But a static class seems simpler.
Regards
|
|
|
|
|
Hii,
i just want to know that How to redirect printer port to c# application.
modified on Tuesday, May 19, 2009 3:08 AM
|
|
|
|
|
Hi,
when we give print a web page opened on browser, how can we know the details of printer like its name etc., using c#?
|
|
|
|
|
Do you want to get the list of installed printers? If yes, work with PrinterSettings.InstalledPrinters property.
|
|
|
|
|
Hi I want the same thing almost, If there are 3types of printers installed,
I want to know the name of Printer which has been selected before giving the printer
|
|
|
|
|
Hi All,
In my windows application I am using 'Zedgraph' dll for displaying graph. In my code I am not using multithreading anywhere. On some of the systems (Windows XP) it shows unhandled exception 'System.InvalidOperationException' (object is currently in use elsewhere). And the instead of graph it just shows RED CROSS.
I have googled about this issue but it says that it may be due to Multithreading and I am not using it anywhere. And the application is running fine but creates problem on some of the systems on my Client side.
Any suggestion would be helpful...
Regards,
-SIFAR.
|
|
|
|
|
What version of .NET FF are you using?
|
|
|
|
|
It is .Net Framework 2.0
Regards,
-SIFAR.
|
|
|
|
|
How to convert a float decimal number into a single precision (4 byte) ?
Thanks
|
|
|
|