Geting XP - Vista with a program

Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Oct 2009
Posts: 47
Reputation: xfrolox is an unknown quantity at this point 
Solved Threads: 0
xfrolox xfrolox is offline Offline
Light Poster

Geting XP - Vista with a program

 
-1
  #1
Oct 15th, 2009
well hi this is my second thread the first one still unsolved lets see about this one.

how can i do that when my program is open and its run in a Vista computer, it have to show a MsgBox and says Error please run as admin and when it is run as admin it wont appear ?

XP don't need to open as admin


P.S sorry for my English. and I'm sorry that i didn't explain good.(i think)
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 271
Reputation: GeekByChoiCe is on a distinguished road 
Solved Threads: 55
GeekByChoiCe GeekByChoiCe is offline Offline
Posting Whiz in Training
 
2
  #2
Oct 16th, 2009
to require admin privileges add into your app.manifest this line
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>

to check for privileges:
  1. if not My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator) then
  2. msgbox "Sorry you have to be an administrator"
  3. end if
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 47
Reputation: xfrolox is an unknown quantity at this point 
Solved Threads: 0
xfrolox xfrolox is offline Offline
Light Poster

Thx

 
0
  #3
Oct 16th, 2009
Originally Posted by GeekByChoiCe View Post
to require admin privileges add into your app.manifest this line
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>

to check for privileges:
  1. if not My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator) then
  2. msgbox "Sorry you have to be an administrator"
  3. end if
i didn't put the line
  1. <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>

i just do this
  1. Dim MymessageBox2
  2. From load
  3. If Not My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator) Then
  4. MymessageBox2 = MsgBox("Please Run as Administrator", MsgBoxStyle.Critical)
  5. If MymessageBox2 = MsgBoxResult.Ok Then
  6. Me.Close()

Thank you my problem is solve
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 306 | Replies: 2
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC