As with all unsafe code, use caution.
与所有不安全代码一样,请谨慎使用。
Using unsafe code introduces security and stability risks.
使用不安全代码将引起安全风险和稳定性风险。
In the common language runtime (CLR), unsafe code is referred to as unverifiable code.
在公共语言运行时(CLR)中,不安全代码是指无法验证的代码。
In unsafe code, an object must be pinned before it can be referred to by an unmanaged pointer.
在不安全代码中,必须先将对象固定,然后非托管指针才可引用该对象。
This error arises in an unsafe code section that contains a fixed-size array declaration similar to a field declaration.
在包含与字段声明相似的固定大小的数组声明的不安全代码段中,会发生此错误。
If you use unsafe code, it is your responsibility to ensure that your code does not introduce security risks or pointer errors.
如果使用不安全代码,由您负责确保您的代码不会引起安全风险或指针错误。
The following example is provided for those very rare situations in which you may want to modify a string in-place by using unsafe code in a manner similar to C-style char arrays.
下面的示例针对的是一种非常罕见的情况,即您可能希望使用不安全代码以类似于C 样式字符数组的方式就地修改字符串。
Unsafe code is not verifiable by the common language runtime.
无法通过公共语言运行时验证不安全代码。
Unsafe code is required when you call native functions that require pointers.
当调用需要指针的本机函数时,需要使用不安全代码。
Unsafe code is required when you call native functions that require pointers.
当调用需要指针的本机函数时,需要使用不安全代码。
应用推荐