通过Webbrowser winforms自动填充Webform(日期字段)

时间:2012-04-22 13:56:46

标签: c# winforms browser autofill datefield

我通过www.irctc.co.in自动完成机票预订流程    直到现在我能够登录..但是当在下一个表单中指定票证详细信息时,我无法设置“旅程日期”字段(带有文本框的日历)值。

我试过这个

        wb.Document.GetElementById("stationFrom").SetAttribute("value", "testStation");
        wb.Document.GetElementById("stationTo").SetAttribute("value","testagain");

        wb.Document.GetElementById("JDatee1").InvokeMember("onfocus");
        wb.Document.GetElementById("JDatee1").SetAttribute("value", "05/31/2012");
        wb.Document.GetElementById("JDatee1").SetAttribute("CurrentDate", "31");
        wb.Document.GetElementById("JDatee1").SetAttribute("CurrentMonth", "05");
        wb.Document.GetElementById("JDatee1").SetAttribute("CurrentYear", "2012"); 
        wb.Document.GetElementById("JDatee1").InvokeMember("onblur");

But after submitting form, date field gets the today's date.. 

Rest of the field I am able to fill.. 

0 个答案:

没有答案