鉴于以下代码,我想知道为什么在编译失败时referenceValue = ConstantInt;有效referenceValue = StaticInt;.
namespace Demo
{
public class Class1
{
private const int ConstantInt = 42;
private static readonly int StaticInt = 42;
public void DemoMethod(ref uint referenceValue)
{
referenceValue = ConstantInt; // This compiles
referenceValue = StaticInt; // This claims that the source type 'int' cannot be converted to 'unit' implicitly.
}
}
}
Run Code Online (Sandbox Code Playgroud) 我目前正在研究我的应用程序安装程序的安全问题。尽管完整的上下文可能与我的问题无关,但这就是我想要做的: https: //skanthak.homepage.t-online.de/ !execute.html
我确实有一个具有提升权限的 CMD,并且被冒充为 SYSTEM,这是我使用 Sysinternals 套件中的 PsExec 进行的(请参阅此)。
当前文件夹是我的用户文件夹内的一个新的空文件夹。
当我执行时
mklink /h version.dll C:\Windows\System32\version.dll
Run Code Online (Sandbox Code Playgroud)
我收到“访问被拒绝”。
我已向我的用户、系统和管理员授予“创建符号链接”权限,如此处答案中所述。
我已使用提升的资源管理器尽可能删除了 windows 文件夹及其所有子文件夹的写保护(特别是 version.dll 没有写保护)
我正在 HyperV 托管的虚拟机中执行所有这些操作。虚拟操作系统是Windows 7 Professional SP1。
为什么命令失败并显示 ACCESS DENIED?