小编Eri*_*ard的帖子

写入Program Files文件夹

我的应用程序包括一个用于更新应用程序的自更新程序可执行文件.

updater执行的第一个步骤之一是检查它是否具有对应用程序文件夹的写入权限

IPermission perm = new FileIOPermission(FileIOPermissionAccess.AllAccess, _localApplicationCodebase);

        if (!SecurityManager.IsGranted(perm))
        {
            OnProgressChanged("Security Permission Not Granted \n The updater does not have read/write access to the application's files (" +
                              _localApplicationCodebase + ")",MessageTypes.Error);
            return false;
        }

        OnProgressChanged("Updater have read/write access to local application files at " + _localApplicationCodebase);
        return true;
Run Code Online (Sandbox Code Playgroud)

IPermission perm = new FileIOPermission(FileIOPermissionAccess.AllAccess, _localApplicationCodebase);

        if (!SecurityManager.IsGranted(perm))
        {
            OnProgressChanged("Security Permission Not Granted \n The updater does not have read/write access to the application's files (" +
                              _localApplicationCodebase + ")",MessageTypes.Error);
            return …
Run Code Online (Sandbox Code Playgroud)

c# uac cas

6
推荐指数
2
解决办法
7055
查看次数

标签 统计

c# ×1

cas ×1

uac ×1