I have a problem where I am using the following code to open an external avi file.
I am outputting the code to external html file for debugging purposes and after I have set my security settings in internet explorer it is working fine.
However, when running through a webBrowser control it does nothing. Is there someway of setting the security settings on my webBrowser control or am I missing something completely.
Code I have is :
I am outputting the code to external html file for debugging purposes and after I have set my security settings in internet explorer it is working fine.
However, when running through a webBrowser control it does nothing. Is there someway of setting the security settings on my webBrowser control or am I missing something completely.
Code I have is :
Code:
public Form1() { InitializeComponent(); MemoryStream HTMLMemory = new MemoryStream(); StreamWriter HTMLWriter = new StreamWriter(HTMLMemory); HTMLWriter.Write("<html><body><input type=button onClick=\" window.location='file:///C:/RDR_Expert_Advisory/Anomaly_ID_surfaces_2010_v.avi'\" value=\"Open File\">"); HTMLWriter.Flush(); HTMLMemory.Position = 0; webBrowser1.DocumentStream = HTMLMemory; // Print code to a txt file StreamWriter sw = new StreamWriter("C:\\RDR_Expert_Advisory\\Test.htm"); StreamReader sr = new StreamReader(HTMLMemory); sw.WriteLine(sr.ReadToEnd()); sw.Close(); HTMLMemory.Position = 0; }
Comment