\"怎么无法转成双引号? 如下的写法fieldstr += "\"" + DataKeyGridView.Rows[i].Cells[1].Text + "\"" + ",";最后fieldstr中还是\",没有转换成双引号。但是在前台又会转成双引号 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string dieldstr = DataKeyGridView.Rows[i].Cells[1].Text + ","; 你现在就是对的,不要在debug状态下看fieldstr内容里没有转换似的。 我现在需要再把fieldstr这个字符串赋值给一个字符组,然后字符组要做为参数使用。我这种写法,在调试时没有转义 for (int i = 0; i < DataKeyGridView.Rows.Count - 1; i++) { CheckBox cbox = (CheckBox)DataKeyGridView.Rows[i].FindControl("CheckBox1"); if (cbox.Checked) { fieldstr +="\"" +DataKeyGridView.Rows[i].Cells[1].Text +"\""+","; } } string[] table = { tablestr }; string[] field = { fieldstr }; xop.InsertNode("//UserInformation/User[@ID='" + userid + "']", "DWInformation", table, field); xop.Save("~/UserInfo/UserDWInformation.xml");这是代码 string fieldstr=string.Empty; fieldstr += DataKeyGridView.Rows[i].Cells[1].Text + ","; 想要的结果是,能把字符串tablestr赋值给字符串组string[] table 。因而需要里面有对应的“号了 不明白 string str = "1";string[] strArr = new[] { str };不需要加 " asp.net上传视频 关于一个时间格式的验证(在线等!急!!!) 问一个超级菜鸟问题! vb6转.net的问题,帮忙看看那 关于DATAGRID的超链接列 如何更改form中的默认提交按钮? 用repeater和checkedBox的时候遇到了问题!在线等 关于ConfigurationManager的问题 请教 100分求助关于Server Error in '/' Application.高手请进 *******asp.net如何制作html模板********* 请教c#语言中的<dictionary>怎么使用
我这种写法,在调试时没有转义
{
CheckBox cbox = (CheckBox)DataKeyGridView.Rows[i].FindControl("CheckBox1");
if (cbox.Checked)
{
fieldstr +="\"" +DataKeyGridView.Rows[i].Cells[1].Text +"\""+",";
}
}
string[] table = { tablestr };
string[] field = { fieldstr };
xop.InsertNode("//UserInformation/User[@ID='" + userid + "']", "DWInformation", table, field);
xop.Save("~/UserInfo/UserDWInformation.xml");
这是代码
string[] strArr = new[] { str };不需要加 "