English 中文(简体)
需要一种可能失败的情景。
原标题:Need a scenario where would fail Array.ConstrainedCopy()
  • 时间:2010-06-01 12:03:19
  •  标签:
  • c#

仅与互联网上的一些亚普西人玩.,我似乎无法找到造成阿雷拉的一条途径。

据MSDN称,它被视为原子操作。 如果在复印件中出现故障,则整个电话没有导致与阿雷拉相比没有复制任何内容。 对应单位。

谁能证明这一点,或者告诉我如何这样做?

该法典在两种版本中都失败。 我只想看到Array.Copy()的例子,它只是复制一些内容,以便更好地了解我可能使用哪一种复制形式。

object[] yer = new object[] { "as", "qwe", "re", 1 };

    string[] copy = new string[yer.Length];

    Array.ConstrainedCopy(yer, 0, copy, 0, yer.Length); // runtime error

    Array.Copy(yer, 0, copy, 0, yer.Length); //runtime error
最佳回答

您可以将一系列类型的目标复制到一系列类型的指令。 如果源阵列中的一项内容不能划入浮体,则该拷贝将失败。 ray.Copy将仅停留在错误发生时, Array.ConstrainingCopy将停止全面作业。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签