我使用一个SQL查询来选择从我的数据库中的数据,并存储在一个Dictionary<string, string>
返回的结果的话,我用一个foreach
环和Server.UrlEncode
创建Querystring
像这样发送多个帖子同时
foreach (var onetwo in privatedictionary)
dataToPost = onetwo.Key+"="+Server.UrlEncode(onetwo.Value)+"&";
那么一旦数据已经被编译进dataToPost
我用HttpWebRequest
发送数据
HttpWebRequest wbrq = (HttpWebRequest)WebRequest.Create("www.sitetohit.com");
{
using (StreamWriter sw = new StreamWriter(wbrq.GetRequestStream()))
{
sw.Write(dataToPost);
}
}
什么是使用Visual Studio 2015
送MUL方式tiple帖子一次?
你可以使用线程并行操作。 –
@TeodorIvanov - 我将在“Parallel.For”中添加哪个部分?我的字典一次只能保存一个值,那么我需要创建多个字典吗?或者可以计算出SQL查询可能返回多少条可能的记录,并在该概念上使用'Parallel.For'? – RashidInman