Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

open a page in IE using c#

Tags:

c#

I'm opening a webpage in IE using c#

Code:

Process.Start("IExplore.exe", "www.northwindtraders.com");

But, how can I resize the page with the following characteritics: toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width='622', height='582'

like image 809
Lucas_Santos Avatar asked Oct 23 '12 12:10

Lucas_Santos


2 Answers

For that level of fine grained control which I do not believe are available from the command line; add a reference (COM) to Microsoft Internet Controls then you can;

var IE = new SHDocVw.InternetExplorer();
object URL = "http://www.northwindtraders.com";

IE.ToolBar = 0;
IE.StatusBar = false;
IE.MenuBar = false;
IE.Width = 622;
IE.Height = 582;
IE.Visible = true;

IE.Navigate2(ref URL);
like image 70
Alex K. Avatar answered Oct 03 '22 03:10

Alex K.


These are the features for opening Internet Explorer from Command Shell:
http://msdn.microsoft.com/en-us/library/hh826025(v=vs.85).aspx

like image 34
Gabriel Marcos Jarczun Avatar answered Oct 03 '22 02:10

Gabriel Marcos Jarczun