Click here to Skip to main content
15,500,921 members
Home / Discussions / C#
   

C#

 
GeneralRe: asking for system tray application Pin
azusakt12-Jan-04 18:51
Memberazusakt12-Jan-04 18:51 
GeneralRe: asking for system tray application Pin
Heath Stewart13-Jan-04 5:53
protectorHeath Stewart13-Jan-04 5:53 
Questionreturning when inside a lock - is it safe? Pin
Brandon Haase12-Jan-04 16:29
MemberBrandon Haase12-Jan-04 16:29 
AnswerRe: returning when inside a lock - is it safe? Pin
Heath Stewart13-Jan-04 5:46
protectorHeath Stewart13-Jan-04 5:46 
GeneralRe: returning when inside a lock - is it safe? Pin
Brandon Haase13-Jan-04 17:13
MemberBrandon Haase13-Jan-04 17:13 
AnswerRe: returning when inside a lock - is it safe? Pin
scadaguy13-Jan-04 6:23
Memberscadaguy13-Jan-04 6:23 
GeneralRe: returning when inside a lock - is it safe? Pin
Brandon Haase13-Jan-04 17:28
MemberBrandon Haase13-Jan-04 17:28 
Generalremoting access Pin
haih12-Jan-04 16:23
Memberhaih12-Jan-04 16:23 
hai everybody... may i know how to write the coding for the log off, reboot and shut down function in C# language. The coding must be able to use own pc so such to control others pc... I got a sample code which is written in VB6 as below:

Private Sub butLogOff_Click()
SystemFunc "logoff"
End Sub

Private Sub butReboot_Click()
SystemFunc "reboot"
End Sub

Private Sub butShutdown_Click()
SystemFunc "shutdown"
End Sub

Private Sub SystemFunc(task As String)
Const CONST_SHUTDOWN = 1
Const CONST_LOGOFF = 0
Const CONST_POWEROFF = 8
Const CONST_REBOOT = 2
Const CONST_FORCE_REBOOT = 6
Const CONST_FORCE_POWEROFF = 12
Const CONST_FORCE_LOGOFF = 4
Const CONST_FORCE_SHUTDOWN = 5
Dim objInstance, objEnumerator, cmdValue, intStatus

Select Case task
Case "logoff"
cmdValue = CONST_LOGOFF
Case "reboot"
cmdValue = CONST_REBOOT
Case "shutdown"
cmdValue = CONST_SHUTDOWN
End Select

Set objEnumerator = objService.ExecQuery("Select * From Win32_OperatingSystem", , 0)

For Each objInstance In objEnumerator
intStatus = objInstance.Win32ShutDown(cmdValue)
If intStatus = 0 Then
ShowStatus "System Function call successful."
Else
ShowStatus "System Function call failed!"
End If
Next
End Sub
GeneralRe: remoting access Pin
Heath Stewart13-Jan-04 5:31
protectorHeath Stewart13-Jan-04 5:31 
GeneralHelp with MonthCalendar class Pin
KingTermite12-Jan-04 16:18
MemberKingTermite12-Jan-04 16:18 
GeneralRe: Help with MonthCalendar class Pin
Heath Stewart13-Jan-04 4:41
protectorHeath Stewart13-Jan-04 4:41 
GeneralRe: Help with MonthCalendar class Pin
KingTermite13-Jan-04 5:27
MemberKingTermite13-Jan-04 5:27 
GeneralRe: Help with MonthCalendar class Pin
Heath Stewart13-Jan-04 5:37
protectorHeath Stewart13-Jan-04 5:37 
GeneralRe: Help with MonthCalendar class Pin
KingTermite13-Jan-04 6:43
MemberKingTermite13-Jan-04 6:43 
GeneralRe: Help with MonthCalendar class Pin
Heath Stewart13-Jan-04 6:50
protectorHeath Stewart13-Jan-04 6:50 
GeneralRe: Help with MonthCalendar class Pin
KingTermite13-Jan-04 7:02
MemberKingTermite13-Jan-04 7:02 
GeneralRe: Help with MonthCalendar class Pin
Heath Stewart13-Jan-04 7:47
protectorHeath Stewart13-Jan-04 7:47 
GeneralRe: Help with MonthCalendar class Pin
KingTermite15-Jan-04 15:49
MemberKingTermite15-Jan-04 15:49 
GeneralRe: Help with MonthCalendar class Pin
Heath Stewart16-Jan-04 4:42
protectorHeath Stewart16-Jan-04 4:42 
GeneralFile Permissions Pin
krisp12-Jan-04 15:54
Memberkrisp12-Jan-04 15:54 
GeneralRe: File Permissions Pin
Jeff Mackie12-Jan-04 18:33
sussJeff Mackie12-Jan-04 18:33 
GeneralRe: File Permissions Pin
krisp12-Jan-04 18:36
Memberkrisp12-Jan-04 18:36 
GeneralRe: File Permissions Pin
Jeff Mackie12-Jan-04 18:48
sussJeff Mackie12-Jan-04 18:48 
GeneralRe: File Permissions Pin
Heath Stewart13-Jan-04 3:57
protectorHeath Stewart13-Jan-04 3:57 
QuestionHow can I use the Cabinet.dll in c# Pin
aw1ay12-Jan-04 15:32
Memberaw1ay12-Jan-04 15:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.