我想使用表单应用将数据发布到网站。我在叫一个班级
string name = pst.Text;
WebClientEx Wex = new WebClientEx(name);
并在课堂上:
public class WebClientEx : WebClient
{
public CookieContainer _cookies = new CookieContainer();
public string Newpost;
public WebClientEx(string name)
{
name = Newpost;
}
我用这种方法发布数据:
public string getPost()
{
WebClientEx client = new WebClientEx();
CQ dom = CQ.Create(Page);
data.Add("value", Newpost);
然而Newpost总是空的。你能救我吗?
答案 0 :(得分:1)
我想你想做
public WebClientEx(string name)
{
Newpost = name;
}