After installation the application gives error
access denied to the file
PathName\\BLsms.ocx
Here PatheName is complete path.
Advance installer is used to create the installer.
Then application is installed in C Drive
.
How can I make these files read and writable?
I am using this code.
try
{
this.brlmfc = new BinaryReader(new FileStream("BLsms.ocx", FileMode.Open, FileAccess.ReadWrite,FileShare.Read));
this.brocx = new BinaryReader(new FileStream("BLrpi.lfc", FileMode.Open,FileAccess.ReadWrite));
this.brlmc = new BinaryReader(new FileStream("rpcgh.lfc", FileMode.Open,FileAccess.ReadWrite));
this.passkey1 = this.brlmfc.ReadString();
this.passkey2 = this.brocx.ReadString();
this.passkey3 = this.brlmc.ReadString();
}
catch (Exception e13)
{
MessageBox.Show(e13.Message);
i = 0;
}
I have also tried the following code in Form Load method.
FileIOPermission f2 = new FileIOPermission(FileIOPermissionAccess.AllAccess, Application.StartupPath+"\\BLsms.ocx");
f2.AddPathList( FileIOPermissionAccess.Read, Application.StartupPath+"\\BLrpi.lfc");
f2.AddPathList( FileIOPermissionAccess.Read, Application.StartupPath+"\\Brpcgh.lfc");
f2.Demand();