请问各位高手在c#中使用数组的问题 是用了多线程吗?是的话试试checkforillegalcall=false;/或者委托调用。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你使用指针了吧。C#中使用指针的代码必须用unsafe扩起来。并且项目属性中Enable "Allow unsafe code" (Build页)// cs_unsafe_keyword.cs// compile with: /unsafeusing System;class UnsafeTest { // unsafe method: takes pointer to int: unsafe static void SquarePtrParam (int* p) { *p *= *p; } unsafe public static void Main() { int i = 5; // unsafe method: uses address-of operator (&) SquarePtrParam (&i); Console.WriteLine (i); }}或者unsafe{ //使用指针}参考:http://msdn.microsoft.com/en-us/library/chfa2zb8(VS.71).aspxhttp://msdn.microsoft.com/en-us/library/t2yzs44b(VS.80).aspx 求SharpDevelop的代码格式化快捷键,以及Visual studio代码格式化快捷键 网口通信协议怎么写? C#在客户端连接服务器数据库时如何保证密码安全性? 传递参数构造连接字符串 100分求助:第二个线程不能进入 程序双击运行正常,放入自启动,开机时错误 一个简单的SQL GROUP BY 排序的问题,高手帮帮忙,急~~~ 求教:如何在连接Access数据库时不使用绝对路径 新手提问:怎样将byte[] 转换为 string(急) 不能做任何连接,因为目标机器积极拒绝它 急求c#如何实现交叉表数据的批量修改,万分感谢! C#程序中的基本语法和基本控件
C#中使用指针的代码必须用unsafe扩起来。并且项目属性中Enable "Allow unsafe code" (Build页)
// cs_unsafe_keyword.cs
// compile with: /unsafe
using System;
class UnsafeTest
{
// unsafe method: takes pointer to int:
unsafe static void SquarePtrParam (int* p)
{
*p *= *p;
}
unsafe public static void Main()
{
int i = 5;
// unsafe method: uses address-of operator (&)
SquarePtrParam (&i);
Console.WriteLine (i);
}
}或者
unsafe
{
//使用指针
}
参考:
http://msdn.microsoft.com/en-us/library/chfa2zb8(VS.71).aspx
http://msdn.microsoft.com/en-us/library/t2yzs44b(VS.80).aspx