0

I need to develop a desktop application. It has to connect to a website and click a 'Submit' button on one of its pages. Basically we have to read a excel sheet (contains invoice numbers),for each invoice number need to hit the 'Submit' button.

Now I have read we can use webbrowser controls , but my requirement is the website should not be opened in the browser , it should all be done internally without opening in any browser, Connect to website , fetch each number and hit a submit button.

Any pointers on this would be helpful.

user1722059
  • 11
  • 1
  • 4
  • 1
    I would suggest looking into web services to do the connections to the website. – Tim Oct 05 '12 at 05:52

2 Answers2

1

it is a good idea to use web service for this IF you can deploy the web service to the website.

if not, you will have to use the web browser control. the web browser control does NOT have to be on the form. you can create a web browser object on the fly. check WebBrowser Control in a new thread

but, web browser usually has more overhead.

instead, you can use fiddler to sniff the traffic and use httpwebrequest/webrequest class to do this.

Community
  • 1
  • 1
urlreader
  • 6,319
  • 7
  • 57
  • 91
  • I agree, this should be implemented via web service. Using an app to emulate user clicks is a really hacky solution. – DeanOC Oct 05 '12 at 06:13
  • No , this is a tactical solution , need this for few users only and we dont have a server to deploy the webservice. The users will use it when they need it to. – user1722059 Oct 05 '12 at 17:38
  • in this case, use web browser control is the simplest way to go. depends on the website you need to access, the httpwebrequest/webclient way may be complex. – urlreader Oct 05 '12 at 18:42
0

You could use the WebRequest class to post the data. See this:

http://www.netomatix.com/httppostdata.aspx

Oscar
  • 13,594
  • 8
  • 47
  • 75