Autor Beitrag
Flitzs
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 123
Erhaltene Danke: 7

Win7 x64/86 WinServer 2008 R2 x64
C#/C++/C VS2010
BeitragVerfasst: Sa 07.03.09 18:34 
Hallo,
ja wie der Titel schon sagt würde ich gerne prüfen ob mein Programm als Administrator ausgeführt wird, oder nicht.

mfg Flitzs
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: Sa 07.03.09 19:41 
Der Suchterm dafür wäre "UAC Elevation", was z.B. hierhin führt: www.itwriting.com/bl...vation-on-vista.html

Edit: Ich gehe jedenfalls mal davon aus, dass es dir um Vistas UAC geht ;) .

_________________
>λ=
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 07.03.09 19:46 
Schau mal hier:
blog.defx.de/2008/07...vista-uac-elevation/
Ergebnis:
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
static internal bool IsElevated()
{
        WindowsIdentity id = WindowsIdentity.GetCurrent();
        WindowsPrincipal p = new WindowsPrincipal(id);
        return p.IsInRole(WindowsBuiltInRole.Administrator);
}
Flitzs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 123
Erhaltene Danke: 7

Win7 x64/86 WinServer 2008 R2 x64
C#/C++/C VS2010
BeitragVerfasst: Sa 07.03.09 23:35 
Hallo,
danke euch beiden für die Antwort, Problem gelöst :D

mfg Flitzs