|
Use Shutdown.exe
process.start("shutdown","-r")
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
--> What do you mean by "-r" in the second argument..?
J A Nasir K
|
|
|
|
|
Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy]
No args Display this message (same as -?)
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c "comment" Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without warning
-d [u][p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive integer less than 256)
yy is the minor reason code (positive integer less than 65536)
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
This is a "poor-man's" solution and only works on XP and above.
Using the Windows API function ExitWindowsEx[^] would be the correct way to go here.
|
|
|
|
|
Wouldn't ExitWindowsEx P/Invoke API help you out?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hello every one,
I am making a application similar to paint brush...
Hear i am finding one issue that pen width '1' is too small and '2' is really big...
is there any way i can have width between 1 and 2?
regards
Nishkarsh
|
|
|
|
|
Hi,
Pen width takes a floating-point number (a Single in your language). Did you ever consider
and try something like 1.5?
|
|
|
|
|
It is taken as a single in VB.net.
I tried 1.5 and all... it did not threw any error but the size also did not changed..
|
|
|
|
|
You could try setting the Smoothing Mode of your graphics object to be of an antialiased:
g.SmoothingMode = SmoothingMode.HighQuality
That will deal with 1/2 pixels well, but is a bit slower.
|
|
|
|
|
you may not notice a difference between 1 and 1.5 when drawing a horizontal or vertical line,
after all the pixels of your screeb are discrete, so it will hit either one row of them, or two.
Things should be different though for slanted lines, circles, etc,
|
|
|
|
|
Thanks a lot to both of you..
Inputs from each one of u had resolved one part of my issue
|
|
|
|
|
Hi Luc
i think i will need a bit more clarity on pen width..
there is for sure some difference between size 1.6 and 2.0 . But there is a huge difference between 1.5 and 1.6 (i am using huge in relative terms only.. )...
This is making the line width uneven in the application...
is there some thing more i need to look at or i am missing out???
Regards
Nishkarsh
|
|
|
|
|
Hi,
I can't help you with detailed information, I haven't done much with pen width yet.
I would look for some properties on either Pen or Graphics that relate to drawing quality,
such as the smoothing thing Jasey9 mentioned. To name a few more: Pen.StartCap, EndCap, LineJoin,
MiterLimit; and Graphics.InterpollationMode, PixelOffsetMode.
You may discover computer graphics is a complex subject...
|
|
|
|
|
hi all,
i want to know the size of particular string for specified font . i use following code
Dim g As Drawing.Graphics <br />
Dim size1 As SizeF<br />
size1 = g.MeasureString(string1, Font1)
in above code, last statement give error . i know there are little error. Can any body told me that how can i correct above statement ?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Rupesh Kumar Swami wrote: in above code, last statement give error
What is the error it gives?
|
|
|
|
|
Hi,
read the little error message and apply a little code correction accordingly.
I hope you did initialize your Graphics object "g", your string "string1" and your Font "Font1".
How do you want us to help you if you don't provide details on the symptoms?
|
|
|
|
|
hi,
i read the error message, which give "NullReferneceException" . I does not use New keyword for graphics object.(or not initialize the object g).i have no idea for this thing. So how can i initialize the object g for measure string size ?
in code snippet(in previous post) string 1 and font1 contains related value.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Try something like:
using bmp as new bitmap(1,1)
using g as graphics=graphics.fromimage(bmp)
[Measure string here using g]
end using
end using
But you will be better off using the correct graphics canvas to use - if you are drawing text to an image, use that image instead of creating a new one like the above example.
|
|
|
|
|
Thanks jasey. Its work for me
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
if you don't assign anything to the reference "g", how do you expect it to do anything for you?
you NEED a Graphics, so get one.
Here are some popular ways:
- inside a Paint handler, use g=PaintEventArgs.Graphics
- if drawing to an Image, use Image.CreateGraphics (warning: expensive operation, make sure
you call dispose afterwards, and don't do this all the time).
|
|
|
|
|
Please i have a working vb.net email application but anytime i have to send emails across a proxy server, it doesnt work
Please any one wana help me?
phatkin
|
|
|
|
|
The .NET Framework SMTP classes currently do not support proxy connections.
|
|
|
|
|
Hi,
I know there's a load of articles about how to avoid the problem of "too many connections" and I have tried searching many of the forums and articles about the topic.
Is there a way to find out how many open connections to an Access mdb using VB.Net 2005.
My program has been used for a long time without any issues, but recently I bought a new PC (with dual core quad processor) and the "too many connections" problem is reappearing.
How is the best way to find out how many connections are open at any point in time.
Thanks for your help.
|
|
|
|
|
Not sure but you should try getting your connections from a pool instead. This is better practice.
|
|
|
|
|
I think you may be running up against the fact that Access is designed as a single user database and should not serve as a neworked DB. Having said that I used one for years with 8 users regularly hanging off it.
Also if you are directly connecting your forms to the database you may be creating a heap of uncontrolled connections. Are you using a DAL. If so use connection pooling.
I would consider the use of Access a fundamental shortcoming, look into converting to SQL Express/Server. This will give you all the control you need and it is a real database. The upgrade/transfer used to be painless (1998).
Never underestimate the power of human stupidity
RAH
|
|
|
|