I've created a windows forms control, which is hosted in a web page viewable with Internet Explorer.
My control reads from a com port and it writes to the event log. Both of these operations by default fail when the framework requests proper permissions. This web application will always be running in the intranet zone, how do I enable these operations?
Serial port code bits & error:
private System.IO.Ports.SerialPort portCardReader_m = new System.IO.Ports.SerialPort();
portCardReader_m.PortName = value;
portCardReader_m.Open(); //Exception here
Request for the permission of type 'System.Security.Permissions.SecurityPermission,mscorlib, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089 failed.
Event Log code bits & error:
System.Diagnostics.EventLog pEventLog = new System.Diagnostics.EventLog("Application", ".", this.GetType().FullName);
pEventLog.WriteEntry(this.Text, System.Diagnostics.EventLogEntryType.Error); //Exception Here
Request for the permission of type 'System.Diagnostics.EventLogPermission,System, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089 failed.
Code to embed my control in the browser:
<object width="600px" height="300px" id="objCardReader" classid="cardreader.dll#CardReader">
<param name="Text" value="Testing" />
<param name="PortName" value="COM5" />
</object>