Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
we are using System.windows.forms.webbrowser to display html page that contains radio buttons when clicked it should call script to create text file and save the answers, but when the radio button clicked a warning message shows up and requires the end user to press Yes to run the script.

the warning is: "an activex control on this page might be unsafe to interact with other parts of the page..."

i want this warning message not to be showed and to run the script, or the Yes button be pressed without interaction from the end user.

What I have tried:

the script:

function WriteToFile(fileName, passForm)
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.CreateTextFile("C:\\test\\" + fileName, true);
s.WriteLine(passForm);
s.Close();
}


the html:
<INPUT TYPE="Radio" Name="HTTP" Value="how many days are in the leap year" onclick="return WriteToFile ('test1.txt','366');"> how many days are in the leap year
Posted
Updated 19-Oct-16 20:30pm
v3
Comments
[no name] 20-Oct-16 5:55am    
"without interaction from the end user", security restrictions were put into computer systems for a reason. You would have to talk the end user into making his computer less secure.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900