Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/268.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在post参数c中添加数组#_C#_Arrays_Asp.net_Dictionary - Fatal编程技术网

C# 在post参数c中添加数组#

C# 在post参数c中添加数组#,c#,arrays,asp.net,dictionary,C#,Arrays,Asp.net,Dictionary,我想在我的post参数中添加如下内容 {"DaysBefore": 5, "IdList": [ 5, 9, 13, 14 ], "pId": 1, "mId": 1 } 我有一本这样的字典 var postData = new Dictionary<string, string>(); postData.Add("IdList","b") var postD

我想在我的post参数中添加如下内容

{"DaysBefore": 5,
"IdList": [
5,
9,
13,
14
 ],
"pId": 1,
"mId": 1
}
我有一本这样的字典

var postData = new Dictionary<string, string>();
postData.Add("IdList","b")
var postData=newdictionary();
添加(“IdList”、“b”)
我怎样才能加上b呢[ 5. 9, 13, 14 ]在那里


我想使用c#

将Generic.List发送到后端,看起来您需要发布一个JSON对象;您应该使用JSON序列化程序而不是字典。