C# 관리자 권한으로 컴파일 및 디버깅

윈도우 Vista 버전 이후로는 관리자 권한이 중요한 key가 되었습니다.
어플리케이션에서도 마찬가지 인데요.
레지스트리 관리 등의 기능을 하기 위해서는 관리자 권한이 꼭 필요합니다.
그럼 Visual Studio 2008에서 WIndows Form Application을
관리자 권한으로 실행해 보도록 하겠습니다.
우선, 솔루션을 생성합니다.

Solution Explorer 의 솔루션에서 Properties(속성)을 클릭합니다.

Security(보안) 탭으로 가서,
Enable ClickOnce Security Setting(ClickOnce 보안 설정 사용)을 선택합니다.

그러면 약간의 버퍼링 후,
Soultion Explorer의 Properties에 App.manifest 파일이 생긴것을 볼 수 있습니다.
이 방법을 이용하지 않을 수도 있지만,
그렇게 하면 더 복잡하니 자동으로 파일을 생성해 주는 이방법을 사용하는게 편합니다 ^^
여기서 중요! ClickOnce의 체크박스를 다시 해지해 줍니다.
ClickOnce에서는 일반 권한밖에 정할 수가 없네요 ㅠ
그럼 관리자 권한 설정을 위해 manifest파일을 엽니다~

중간 부분에 보면 주석과 함께 아래와 같은 코드가 있는 것을 볼 수 있네요.

         <!– UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.<requestedExecutionLevel  level=”asInvoker” uiAccess=”false” />
<requestedExecutionLevel  level=”requireAdministrator” uiAccess=”false” />
<requestedExecutionLevel  level=”highestAvailable” uiAccess=”false” />If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
–>

권한 설정을 위해 아래의 코드 중에 선택하라.. 뭐 이런 말 같은데요ㅎㅎ
우리는 관리자 권한을 위해
<requestedExecutionLevel  level=”requireAdministrator” uiAccess=”false” />
이 코드를 asInvoker 대신 삽입해 줍니다.

그러면 완료! 프로그램이 관리자 권한으로 실행되게 됩니다~

“C# 관리자 권한으로 컴파일 및 디버깅”의 28개의 댓글

  1. I don’t even know how I ended up here, but I thought this
    post was great. I do not know who you are but definitely you’re going to a famous blogger if you aren’t already 😉 Cheers!

  2. I simply want to say I am just newbie to blogging and site-building and definitely liked this web page. Likely I’m want to bookmark your blog post . You certainly have tremendous article content. Thanks for sharing with us your web site.

  3. The following time I review a blog site, I hope that it does not disappoint me as high as this set. I suggest, I understand it was my selection to check out, but I in fact believed youd have something interesting to claim. All I hear is a lot of yawping regarding something that you might repair if you werent also hectic searching for attention.

  4. There are certainly a lot of details like that to take into consideration. That is an excellent point to raise. I offer the ideas above as basic inspiration yet plainly there are inquiries like the one you raise where the most important point will certainly be operating in sincere good faith. I don?t know if best practices have arised around things like that, yet I make sure that your work is plainly determined as a fair game. Both young boys as well as girls feel the effect of simply a moment?s enjoyment, for the remainder of their lives.

  5. I am really impressed with your writing skills well with the layout for your weblog. Is that this a paid subject matter or did you modify it your self? Anyway stay up the nice high quality writing, it is rare to see a nice weblog like this one these days.

  6. There are certainly a lot of details like that to take into account. That is a wonderful point to bring up. I offer the ideas over as general ideas but clearly there are concerns like the one you bring up where the most vital thing will certainly be operating in sincere good faith. I don?t understand if best methods have actually arised around points like that, yet I make certain that your job is plainly identified as an up for grabs. Both children and also girls feel the effect of just a moment?s enjoyment, for the remainder of their lives.

  7. With havin so much content and articles do you ever
    run into any issues of plagorism or copyright violation? My
    website has a lot of unique content I’ve either created myself or outsourced but it appears a lot
    of it is popping it up all over the web without my permission. Do
    you know any techniques to help reduce content from being stolen? I’d really
    appreciate it.

  8. There are definitely a lot of information like that to take into account. That is a terrific point to bring up. I offer the ideas over as basic ideas but plainly there are concerns like the one you raise where the most essential thing will be working in honest good faith. I don?t recognize if ideal practices have arised around points like that, however I make sure that your task is clearly recognized as an up for grabs. Both young boys and women feel the effect of just a moment?s satisfaction, for the remainder of their lives.

  9. Aw, this was a truly wonderful message. In suggestion I want to put in composing such as this furthermore? taking some time and also actual effort to make a very good article? yet what can I claim? I procrastinate alot as well as by no means appear to obtain something done.

  10. A fascinating discussion deserves comment. I assume that you should compose extra on this subject, it may not be a frowned on topic but generally individuals are insufficient to talk on such subjects. To the following. Thanks

  11. Thanks for one’s marvelous posting! I seriously enjoyed reading it, you are a great author.I
    will remember to bookmark your blog and will eventually come back
    in the foreseeable future. I want to encourage continue your
    great writing, have a nice evening!

댓글 남기기