SetValue

skywolfY skywolfY 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区


//stcTmp 是个结构体

public struct stc1
{

public string sTable;

public string sColumn;

public stcColumn(int n)
{
sTable = "";
sColumn = "";

}
}
stc1 stcTmp =new stc1(0);
foreach (FieldInfo fiTmp in stcTmp.GetType().GetFields())
{
if (fiTmp != null)
{
fiTmp.SetValue(stcTmp, "aaa");
}
}

这句 fiTmp.SetValue(stcTmp, "aaa")无效,请问各位高手哪里错了?
...全文

相关推荐

评论 7
收藏 已收藏
分享
返回顶部
skywolfY
C# 111,128 成员 642,537 内容