AxWebBrowser not in WinForm

  • Thread starter Thread starter Djavdet
  • Start date Start date
D

Djavdet

Hi everyone,
I need to work with web sites from my program but i don't need to show
web site content.. I only need to get web page change something in html
document and either move on or send something back..
Basically pretty much the same what usually people would do with IE but
no windows...
I thought that it would be easier to implement using AxWebBrowser
ActiveX control, but I can't figure out how to set that OCXState field
if I don't create object within WinForm. If don't set it , I get
InvalidActiveXStateException...
So I guess my question is, how to use AxWebBrowser control without
WinForm or maybe there is a better way to solve my problem?
Thanks
D.
 
D,

I am not sure what you mean by ---
I only need to get web page change something in html
document and either move on or send something back..

But, I recently posted a little short code snippet on my blog -
http://dotnetjunkies.com/WebLog/sahilmalik/archive/2005/01/06/42130.aspx
that lets you easily retreive a URL and save it as MHT. Instead of saving,
you could get a string out of it, and work with it.

That right there is unmanaged code (uses interop), but there are other
managed ways to acheive this goal too. Unfortunately none of them allow you
to save as MHT but you might not need to do that.

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
 
Assuming you are only trying to get HTML code of a given site, you can do a
Get request using HTTP protocol to get the code of HTML on the page.
 
Well,
yeah, but that gives me kinda read only access to the web site...
I need also interact with web site or send something back...

D.
 
Solution depends on scenario you have. If webserver is local to you, or you
can access it directly and you have read/write rights then you can make
small FTP application to put html files (publishing folder). In that case
you really do not need to use HTTP protocol, you can directly access the
file you want to change. What is your scenario?
 
Hi,
no it is not the case.
My web servers are all in the internet...
I am surprised that there is no other objects then IE ActiveX
control...
D.
 
Thanks,
no, this is not what i need.
Like i said this is too much low level..
I guess i was looking for somethig like AxWebBrowser but without HTML
renderer..
D.
 
Hi thanks for your interest.
I sort of solved the problem by using AxWebBrowser control.
It's kinda bulky awkward solution but it works that's what matters.
D.
 
Back
Top