/// <summary> /// 加载数据记录 /// </summary> /// <param name="name">名称</param> /// <param name="node"></param> public void LoadMember(subString name, xmlNode node) {//https://msdn.microsoft.com/zh-cn/library/fsbx0t7x(v=vs.80).aspx //对于泛型类型,类型名称后跟反勾号,再跟一个数字,指示泛型类型参数的个数。例如, //<member name="T:SampleClass`2"> 是定义为 public class SampleClass<T, U> 的类型的标记。 if (name[1] == ':') { char code = name[0]; switch (code & 7) { case 'T' & 7: //类型:类、接口、结构、枚举、委托 if (code == 'T') { types[name.Substring(2)] = node; } break; case 'F' & 7: //字段 if (code == 'F') { fields[name.Substring(2)] = node; } break; case 'P' & 7: //属性(包括索引程序或其他索引属性) if (code == 'P') { properties[name.Substring(2)] = node; } break; case 'M' & 7: //方法(包括一些特殊方法,例如构造函数、运算符等) if (code == 'M') { methods[name.Substring(2)] = node; } break; //case 'E' & 7://事件 // break; //case 'N' & 7://命名空间 //case '!' & 7://错误字符串 //break; } } }
/// <summary> /// 根据提交类型获取编码字符集 /// </summary> /// <param name="contentType">提交类型</param> /// <returns>编码字符集</returns> private static Encoding getEncoding(string contentType) { foreach (subString value in contentType.Split(';')) { subString key = value.Trim(); if (key.StartsWith(webClient.CharsetName)) { try { Encoding encoding = Encoding.GetEncoding(key.Substring(webClient.CharsetName.Length)); return(encoding); } catch { } } } return(null); }