![]() |
| |||||||
| Programlama C,Delphi,Visual Basic ve diğer tüm programlama dilleri hakkında dökümanlar ve bilgilerin merkezi |
| | |
|
| | LinkBack | Konu Seçenekleri |
| | #1 |
| Admin ![]()
Mesajlar: 1.976
Puan: 6015 | Modüle Yazılacaklar Code: Imports System.Runtime.InteropServices* ' DLL import etmek için gerekli
Module ademeyuboglu
* * Const SE_PRIVILEGE_ENABLED As Integer = &H2
* * Const TOKEN_QUERY As Integer = &H8
* * Const TOKEN_ADJUST_PRIVILEGES As Integer = &H20
* * Const SE_SHUTDOWN_NAME As String = "SeShutdownPrivilege"
* * <StructLayout(LayoutKind.Sequential, Pack:=1)> _
* * Friend Structure Luid
* * * * Public Count As Integer
* * * * Public Luid As Long
* * * * Public Attr As Integer
* * End Structure 'TokPriv1Luid
* * <DllImport("kernel32.dll", ExactSpelling:=True)> _
* * Function GetCurrentProcess() As IntPtr
* * End Function
* * <DllImport("advapi32.dll", SetLastError:=True)> _
* * Function OpenProcessToken(ByVal h As IntPtr, ByVal acc As Integer, ByRef phtok As IntPtr) As Boolean
* * End Function
* * <DllImport("advapi32.dll", SetLastError:=True)> _
* * Friend Function LookupPrivilegeValue(ByVal host As String, ByVal name As String, ByRef pluid As Long) As Boolean
* * End Function
* * <DllImport("advapi32.dll", ExactSpelling:=True, SetLastError:=True)> _
* * Friend Function AdjustTokenPrivileges(ByVal htok As IntPtr, ByVal disall As Boolean, ByRef newst As Luid, ByVal len As Integer, ByVal prev As IntPtr, ByVal relen As IntPtr) As Boolean
* * End Function
* * <DllImport("user32.dll", ExactSpelling:=True, SetLastError:=True)> _
* * Friend Function ExitWindowsEx(ByVal flg As Integer, ByVal rea As Integer) As Boolean
* * End Function
* * Public Sub DoExitWindows(ByVal flg As Integer)
* * * * Dim tp As Luid
* * * * Dim hproc As IntPtr = GetCurrentProcess()
* * * * Dim htok As IntPtr = IntPtr.Zero
* * * * OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES Or TOKEN_QUERY, htok)
* * * * tp.Count = 1
* * * * tp.Luid = 0
* * * * tp.Attr = SE_PRIVILEGE_ENABLED
* * * * LookupPrivilegeValue(Nothing, SE_SHUTDOWN_NAME, tp.Luid)
* * * * AdjustTokenPrivileges(htok, False, tp, 0, IntPtr.Zero, IntPtr.Zero)
* * * * ExitWindowsEx(flg, 0)
* * End Sub
End Module
Kullanım: Code: ' Sabit tanımlamaları * * Inherits System.Windows.Forms.Form * * Const EWX_LOGOFF As Integer = &H0 * * Const EWX_SHUTDOWN As Integer = &H1 * * Const EWX_REBOOT As Integer = &H2 * * Const EWX_FORCE As Integer = &H4 * * Const EWX_POWEROFF As Integer = &H8 * * Const EWX_FORCEIFHUNG As Integer = &H10 Private sub Button1_Click() * * DoExitWindows(EWX_LOGOFF) * * DoExitWindows(EWX_SHUTDOWN) * * . * * . * * . End Sub
__________________ ![]() |
|
| | #2 |
| Bakan ![]()
Mesajlar: 346
Puan: 1402 | yaw bunlar güzel ama bu vb nasıl öğrencez kitap okumak istmiyom yokmu bunun görsel eğitim seti felan (beleş olsun netten felan indirek ) ![]()
__________________ Bu cinayet!... Günahın en has hali ihanet Hakkımı ver gideyim adalet Son kozum olsun zorda sükunet Kendime sarılır donarım |
|
| | #3 |
| Bakan ![]()
Mesajlar: 330
Puan: 10 | benim bunları okuyarak öğrenmem yıllar alabilir ![]() |
|
| | #4 |
| Milletvekili ![]()
Mesajlar: 154
Puan: 11 | saol kardeşim emeğine sağlık
__________________ RoCk'n RoLl... |
|
| | #5 |
| Halk ![]()
Mesajlar: 5
Puan: 10 | nereye kopyalıcaz onlarıda yazsaydın kardeş |
|
![]() |
| Konuyu toplam 0 üye ve 1 ziyaretçi okuyor | |
| Konu Seçenekleri | |
|
|
Benzer Konular | ||||
| Konu | Konuyu Açan | Forum | Cevaplar | Son Mesaj |
| Bilgisayar Kapat 1.0 | DovDoviC | Programlar | 1 | 30.08.2007 03:49 |
| Microsoft'un Masa Gibi Bilgisayarı | turk11 | İnternet Genel | 2 | 20.08.2007 16:20 |
| Uzaktan Kapat 2.1 | THE MUMMY | Programlar | 1 | 19.07.2007 15:28 |
| WindowsXP - KB835732 | THE MUMMY | Programlar | 0 | 26.01.2007 22:33 |