-1

I have a managed application which has a web browser component. I am trying to write a program which automatically fills some HTML text fields , set some HTML combo boxes, click buttons... I have done these sort of things. The program supposed to upload some excel files to a remote server. The excel files are attached to an HTML form. That is the point I am stacked at.

I know this issue has been talked on SO but I am stucked at the point of setting this famous html element type=file . I dig in the forums and web about this situation. I read that with IE 6.0 ActiveX wrapper , one can manage to set file chooser HTML element by Send.SendKeys() security hole.

My question is:

In my recent code I am using a wrapper class which I found here : http://blogs.artinsoft.net/mrojas/archive/2008/09/18/newwindow2-events-in-the-c-webbrowsercontrol.aspx since IE 8.0 is installed on my win7 I am automatically wrapping IE 8.0. Is it possible to wrap IE 6.0 on .NET 4.0 and on windows 7 and IS IT POSSIBLE TO SOMEHOW VIRTUALIZE YOUR PROGRAM FOR JUST USING IE 6.0 SINCE THE USER OF THE PROGRAMS MAY NOT WANT TO INSTALL IE 6.0. And I did not try this; Is it possible to set the filechooser text field with IE 6.0. And Where can I get IE 6.0 ?

If someone helps , I assure that I pray for him/her to the rest of my entire life. Thanks.

note:any comment if my path is wrong from the beginning , would be very appreciated... thanks again.

cgon
  • 1,955
  • 2
  • 23
  • 37
  • 1
    There's no supported way to do this, no. – EricLaw Jun 23 '11 at 03:52
  • Ok now I can sleep well since I got a minus on the question. Now I know my path is wrong. I will use System.NET classes to the automation. WebBrowser can be a good automation tool exception of file chooser. – cgon Jun 23 '11 at 08:25

2 Answers2

1

Why wrap IE 6 to automate this when you can achieve the same result by using Selenium?

Keith Adler
  • 20,880
  • 28
  • 119
  • 189
1

A security hole is not a feature, it is a bug. Don't rely on the existance of a bug. I think this hole is fixed in all modern versions of manjor browsers, so if you embed an open source webbrowser into your solution you need to find a very old one (e.g. FireFox 1.5).

EricLaw
  • 56,563
  • 7
  • 151
  • 196
Sheng Jiang 蒋晟
  • 15,125
  • 2
  • 28
  • 46