C# 如何将帖子数据发送到认证后的网站?

C# 如何将帖子数据发送到认证后的网站?,c#,post,C#,Post,我正在做一个爱好项目,有一个网站支持身份验证,它允许我为产品(价格、销售价格、名称等)生成促销材料。我想通过从MySQL数据库获取数据并将其自动传递到网站来实现这一过程的自动化。我可以毫无问题地从数据库中读取数据,但我一直在向网站发送POST请求 该网站如下所示: 制作宣传材料的网站(荷兰语) 我使用wireshark来了解当您单击submit按钮(“voorbeeld tonen”)时会发生什么,http数据非常庞大。。。我附上了wireshark文件,所以你可以自己查看,基本上它包含了很多

我正在做一个爱好项目,有一个网站支持身份验证,它允许我为产品(价格、销售价格、名称等)生成促销材料。我想通过从MySQL数据库获取数据并将其自动传递到网站来实现这一过程的自动化。我可以毫无问题地从数据库中读取数据,但我一直在向网站发送POST请求

该网站如下所示:

制作宣传材料的网站(荷兰语)

我使用wireshark来了解当您单击submit按钮(“voorbeeld tonen”)时会发生什么,http数据非常庞大。。。我附上了wireshark文件,所以你可以自己查看,基本上它包含了很多参数

这是我用于提交数据的代码:

            private void SendPost()
        {
            string url = "http://emte20.bek.nl/nl/publicationvariants/62422/refresh";
            using (var wb = new WebClient())
            {
                var data = new NameValueCollection();
                data["field[__PRODUCTnaam__#!#value]"] = "myUser";
                data["field[__PRODUCTomschrijving__#!#value]"] = "myPassword";



                var response = wb.UploadValues(url, "POST", data);
                string responseInString = Encoding.UTF8.GetString(response);
                richTextBox1.Text = responseInString;
            }
        }
当我尝试执行该函数时,它只会给我一个422错误:

.System.Net.WebException
HResult=0x80131509
Message=De externe server heeft een fout geretourneerd:(422)不可处理的实体。
来源=系统
堆栈跟踪:
在System.Net.WebClient.UploadValues(Uri地址、字符串方法、NameValueCollection数据)
在System.Net.WebClient.UploadValues中(字符串地址、字符串方法、NameValueCollection数据)
在C:\Users\joep\source\repos\StoreManager\StoreManager\DBmanager.cs中的StoreManager.dbmanagerform.SendPost()处:第43行
在C:\Users\joep\source\repos\StoreManager\StoreManager\DBmanager.cs中加载(对象发送方,事件参数e):第29行
在System.Windows.Forms.Form.OnLoad(EventArgs e)中
在System.Windows.Forms.Form.OnCreateControl()中
位于System.Windows.Forms.Control.CreateControl(布尔值不可修改)
在System.Windows.Forms.Control.CreateControl()中
在System.Windows.Forms.Control.WmShowWindow(Message&m)中
位于System.Windows.Forms.Control.WndProc(Message&m)
在System.Windows.Forms.ScrollableControl.WndProc(Message&m)中
在System.Windows.Forms.Form.WmShowWindow(消息和消息)
在System.Windows.Forms.Form.WndProc(Message&m)中
在System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&m)中
在System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&m)中

在System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd、Int32 msg、IntPtr wparam、IntPtr lparam)
file.io链接似乎已断开。真的有那么多东西你不能贴在这里吗?