Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
{TuToRiAl} How To Verify If Your App. Was Ran As Administrator {TuToRiAl}
#1
Hello there. Today I shall be teaching you how to verify if your application had been ran as an administrator with administrator privileges all in a few easy lines of code.

So allow me to demonstrate:

Get Your Project Ready.

Then make a label named Status

Then have a button.

Double click the button and use this code:
Code:
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator) Then
            Status.Text = "Yes, I am the big boss."
        Else
            Status.Text = "No, maybe next time."
        End If
    End Sub
End Class

Here is a little animation for you guys below to show some results:
[Image: 9XJfI.gif]

Enjoy and don't forget to say thanks if this helps.
[Image: t5BWm.png]
Reply
#2
Nice example! Could be useful in things like auto-updating.

Can I ask sth irrelevant? How do you create the animation?
My software company: Porosis Software
Games: Terrantula
Apps: Mathanasis, ColorGrabber
Reply
#3
(04-21-2011, 12:32 AM)thanasis2028 Wrote: Nice example! Could be useful in things like auto-updating.

Can I ask sth irrelevant? How do you create the animation?

Camtasia studio, output as gif instead of movie.
Reply
#4
(04-21-2011, 01:39 AM)Infinity Wrote: Camtasia studio, output as gif instead of movie.

I already sent him a private message Infinity. Right now I am going to make a tutorial on that whole process and post the thread here. I believe people will find it somewhat helpful.
[Image: t5BWm.png]
Reply
#5
(04-21-2011, 10:36 AM)The High Roller Wrote: I already sent him a private message Infinity. Right now I am going to make a tutorial on that whole process and post the thread here. I believe people will find it somewhat helpful.

I'd rather just make videos, but I know of other people that use gifs instead like you have. And you never know, maybe I posted it before you sent him the private message lol. You didn't notice until today that I gave him a method of making the gif as well.
Reply
#6
(04-21-2011, 02:38 PM)Infinity Wrote: I'd rather just make videos, but I know of other people that use gifs instead like you have. And you never know, maybe I posted it before you sent him the private message lol. You didn't notice until today that I gave him a method of making the gif as well.

Listen, the second I got the email notification I started hitting him up a PM. Impossible you beat me to it Big Grin no lie.
[Image: t5BWm.png]
Reply
#7
(04-21-2011, 06:06 PM)The High Roller Wrote: Listen, the second I got the email notification I started hitting him up a PM. Impossible you beat me to it Big Grin no lie.

I don't know, i'm pretty fast with responses lol Smile But if you did it the within the first 10 minutes of that comment, then you beat me. I don't like using that personally because it's not as high quality as a video, and you can't have control over what part of the 'animation' you view with a gif.

Back on topic though, this would be useful for a few things i've noticed.
Reply
#8
Wow, I didn't even know you could do this.
Thanks a lot, definitely adding some 'Run as admin.' screensSmile
Reply
#9
(09-03-2011, 05:30 AM).edit Wrote: Wow, I didn't even know you could do this.
Thanks a lot, definitely adding some 'Run as admin.' screensSmile

ofc we could do this, Thanks O.P. for making this...
Reply
#10
I've never tried this before. I'll be trying this out pretty soon. Thanks for sharing it.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [HELP]Tutorial/Learning System[HELP] norBATman 2 1,089 09-08-2012, 10:17 PM
Last Post: AceInfinity
  [TuToRiAl] How to make Offline (No Internet) Captcha (Human Confirmation) [TuToRiAl] Resistance 24 10,926 08-30-2012, 10:14 PM
Last Post: Resistance
  [Visual Basic] FTP Uploader [Tutorial] Coding Support 6 2,730 08-12-2012, 12:36 AM
Last Post: Kenneth
  [RELEASE]SF-TutPad "Tutorial Editor" [RELEASE] Digital-Punk 28 8,690 08-11-2012, 11:25 PM
Last Post: Kenneth
  Emailer Tutorial dunlop03 12 2,361 06-24-2012, 04:33 AM
Last Post: kpn37z

Forum Jump:


Users browsing this thread: 1 Guest(s)