与所有不安全代码一样,请谨慎使用。
无法通过公共语言运行时验证不安全代码。
Unsafe code is not verifiable by the common language runtime.
使用不安全代码将引起安全风险和稳定性风险。
当调用需要指针的本机函数时,需要使用不安全代码。
Unsafe code is required when you call native functions that require pointers.
在公共语言运行时(CLR)中,不安全代码是指无法验证的代码。
In the common language runtime (CLR), unsafe code is referred to as unverifiable code.
在不安全代码中,必须先将对象固定,然后非托管指针才可引用该对象。
In unsafe code, an object must be pinned before it can be referred to by an unmanaged pointer.
如果使用不安全代码,由您负责确保您的代码不会引起安全风险或指针错误。
If you use unsafe code, it is your responsibility to ensure that your code does not introduce security risks or pointer errors.
在包含与字段声明相似的固定大小的数组声明的不安全代码段中,会发生此错误。
This error arises in an unsafe code section that contains a fixed-size array declaration similar to a field declaration.
下面的示例针对的是一种非常罕见的情况,即您可能希望使用不安全代码以类似于C 样式字符数组的方式就地修改字符串。
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.
如果存在一种针对此情形的更安全(且可能更快)的语言风格(映射-减法),则没有借口编写这样的不安全代码,即使它“在此情形下”看起来是安全的。
Given that a safer (and possibly faster) idiom exists for this - map-reduce - there's no excuse for writing such unsafe code, even if it seems safe "in this case."
如果您按照这个方式调用键不安全的函数,那么粘合代码将能够识别具体的情况,并帮助您对其进行相应处理。
If you call out this way to key-unsafe functions, the glue code recognizes the situation and takes care of it for you.
由于分配规则的限制,通常使用静态字段或其他缓存数据方式的代码会使范围不安全,可能导致IllegalAssignmentError。
Code that makes common use of static fields or other means of caching data is unsafe for scopes because of the assignment rules, which can result in an IllegalAssignmentError.
另一个是个人客户,他在站点安全性方面比较宽松,可能将不安全的代码上载到这个站点。
The other is an individual customer who is lax about site security and is known to upload insecure code to his site.
由于证书可能是不安全的,因此会返回错误代码。
Error return codes are given because the certificate is potentially unsafe.
这可能导致系统不安全,因为黑客可以编写代码来直接调用EJB,而得以绕过web层。
This can lead to an insecure system, as hackers may be able to write code to call the EJB directly and bypass the Web tier.
不支持标准的。NET类库,因为它包含了不安全的代码。
Does not support the standard.net class library due to its inclusion of unsafe code?
人们会不由自主地将开源和无数行代码、后台技术、服务器机房、计算机实验室以及试验(理解为不安全、充斥着bug的)技术联系在一起。
People automatically associate it with endless lines of code, back-end technology, server rooms, computer science labs, and experimental (read: unsafe and buggy) technology.
本页解释了一个人如何写安全代码使用这个指令,但记住指令本身不是不安全的,除非当它被错误使用时。
This page will explain how one can write insecure code with this directive but keep in mind that the directive itself isn't insecure but rather it's the misuse of it.
方法、类型和可被定义为不安全的代码块。
不安全的原因在于纯代码与本机代码(或混合本机代码与托管代码)之间的默认调用约定存在差异。
This is unsafe because of the difference in the default calling conventions between pure and native code (or mixed native and managed).
不安全的原因在于纯代码与本机代码(或混合本机代码与托管代码)之间的默认调用约定存在差异。
This is unsafe because of the difference in the default calling conventions between pure and native code (or mixed native and managed).
应用推荐