您的位置:首页 > 其它

Havij v1.13 Pro CracKed By Hmily[LCG][DST]

2010-12-13 14:51 225 查看
XMLopr xmlpro = new XMLopr();
string xmlpath = WebConfigurationManager.AppSettings["fileinfo_Filexmlpath"].ToString();
xmlpath = Server.MapPath(xmlpath);
Dictionary<string, string> filedmap = xmlpro.ReadXmlFiled(xmlpath);
if (filedmap == null)
{
result="读取字段匹配设置文档失败!";
return result;
}
int i = 0;
foreach (KeyValuePair<string,string> keypair in filedmap)
{
//获取值
string value =dr[keypair.Key.Trim()]==null?"":dr[keypair.Key.Trim()].ToString().Trim();
//获取映射字段
string mapfiled = keypair.Value.Trim();
//判断映射字段类型
PropertyInfo property = fileModel.GetType().GetProperty(mapfiled);
if (property.PropertyType.Name.ToLower().Equals("string"))
{
property.SetValue(fileModel,value,null);
}
else if (property.PropertyType.Name.Equals("int32"))
{
property.SetValue(fileModel, int.Parse(value), null);
}
else if (property.PropertyType.Name.Equals("DateTime"))
{
if(value.Trim()!=string.Empty)
property.SetValue(fileModel,DateTime.Parse(value), null);
}
}

本文出自 “技术人” 博客,请务必保留此出处http://1777783.blog.51cto.com/1767783/1281586
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: