arcengine调用gp查看具体的报错信息

常规的try catch不能看到是哪个参数错了,每次都有人问,每次要去找以前写的代码才知道,因此记录一下

catch (Exception ex)
            {
                string str = "";
                for (int i = 0; i < gp.MessageCount; i++)
                {
                    str += gp.GetMessage(i);
                    str += "\n";
                }
                Console.Write(str);
            }

你可能感兴趣的:(arcengine)