2012年3月28日 星期三

XML Path Language (XPath)

為什麼要使用XPath呢? 其實對於一份XML文件而言, 他的結構如同我們在檔案系統裡面所看到的結構, 雖不同, 但亦不遠矣, 所以就有很聰明的人想到, 那能不能像目錄結構一樣的來查詢或是訪問這些存在XML裡的資料呢? 答案當然是可行的…

2012年3月19日 星期一

Embdded “requireAdministrator” in VS2005

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="<AppName>" type="win32"/>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="requireAdministrator"/>
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>
將上面的copy下來檔存成.manifest, 然後開啟VS2005, 依下面步驟
  1. Open your project in Microsoft Visual Studio 2005.
  2. Under Project, select Properties.
  3. In Properties, select Manifest Tool, and then select Input and Output.
  4. Add in the name of your application manifest file under Additional manifest files.
  5. Rebuild your application.
這樣應該就看得到小盾牌, 也可以直按icon, 就會跳出UAC畫面(前提是你的UAC要開…)