大神帮帮忙,小弟在此谢过了 C# 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 应该是反编译器没有正确处理foreach(解析成while了)和其中的break/continue导致的。 public static MethodInfo GetMethod(Type type, string method, object[] args) { MethodInfo info3; Type[] types = Type.GetTypeArray(args); MethodInfo info = type.GetMethod(method, types); if (info != null) { return info; } MethodInfo[] methods = type.GetMethods(); List<MethodInfo> list = new List<MethodInfo>(); foreach (MethodInfo info4 in methods) { if (string.Compare(info4.Name, method) == 0) { list.Add(info4); } } using (List<MethodInfo>.Enumerator enumerator = list.GetEnumerator()) { MethodInfo current; while (enumerator.MoveNext()) { current = enumerator.Current; ParameterInfo[] parameters = current.GetParameters(); if (parameters.Length != args.Length) { continue; } bool flag = true; for (int i = 0; i < parameters.Length; i++) { Type parameterType = parameters[i].ParameterType; if (parameterType.IsByRef) { parameterType = Type.GetType(parameterType.FullName.Substring(0, parameterType.FullName.Length - 1)); } Type c = args[i].GetType(); if (!parameterType.IsAssignableFrom(c)) { flag = false; } } if (flag) { info3 = current; } } return null; } } http://www.cnblogs.com/ghfsusan/archive/2009/04/29/1446353.html 谢谢 大虾 能翻译成foreach 的吗 http://blog.csdn.net/seizef/article/details/6653298http://blog.csdn.net/dyllove98/article/details/9771731 用了线程,怎样让它不卡。简单的线程问题求助!! directshow做的播放器 制作控件 怎么动态添加同一控件多次?? ? C#中,怎样在指定的TabPages中动态建立控件 关于搜索引擎的技术实现!? C#如何直接操纵word? 这是个什么语法? 什么时候加入的? 求助:往cs文件里写汉字变成乱码的问题 急急急!!!在线等 求解答!这是数学的问题吧 SqlDataSource查询如何增加另一页面发回的id号,从而过滤一些数据
{
MethodInfo info3;
Type[] types = Type.GetTypeArray(args);
MethodInfo info = type.GetMethod(method, types);
if (info != null)
{
return info;
}
MethodInfo[] methods = type.GetMethods();
List<MethodInfo> list = new List<MethodInfo>();
foreach (MethodInfo info4 in methods)
{
if (string.Compare(info4.Name, method) == 0)
{
list.Add(info4);
}
}
using (List<MethodInfo>.Enumerator enumerator = list.GetEnumerator())
{
MethodInfo current;
while (enumerator.MoveNext())
{
current = enumerator.Current;
ParameterInfo[] parameters = current.GetParameters();
if (parameters.Length != args.Length)
{
continue;
}
bool flag = true;
for (int i = 0; i < parameters.Length; i++)
{
Type parameterType = parameters[i].ParameterType;
if (parameterType.IsByRef)
{
parameterType = Type.GetType(parameterType.FullName.Substring(0, parameterType.FullName.Length - 1));
}
Type c = args[i].GetType();
if (!parameterType.IsAssignableFrom(c))
{
flag = false;
}
}
if (flag)
{
info3 = current;
}
}
return null;
}
}
谢谢 大虾 能翻译成foreach 的吗
http://blog.csdn.net/seizef/article/details/6653298
http://blog.csdn.net/dyllove98/article/details/9771731