我已经彻底搜索了整个访问被拒绝的问题,并且没有找到任何与我自己的系统上访问Windows窗体相关的问题,所有问题都与Web应用程序有关.
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
byte[] imgdata;
FileStream fsrw;
string fname;
openFileDialog1.Filter = "Sai Files(*.JPG;*.GIF)|*.jpg;*.gif|All files (*.*)|*.*";
openFileDialog1.ShowDialog();//opens the dialog box
fname = openFileDialog1.FileName;//stores the file name in fname
pictureBox1.ImageLocation = fname;//gives the image location to picturebox
fsrw = new FileStream("C:\\Users\\Sainath\\Desktop", FileMode.Open, FileAccess.ReadWrite);
imgdata = new byte[fsrw.Length];
fsrw.Read(imgdata, 0, Convert.ToInt32(fsrw.Length));
fsrw.Close();
string s = "insert into imagetest values(@p1,@p2)";
SqlConnection con = new SqlConnection("server=.;Data Source=.;Initial Catalog=Work;Integrated …
Run Code Online (Sandbox Code Playgroud) 我创建了一个JavaScript变量,当我点击按钮时它应该增加1,但它没有发生.
这是manifest.json
.
{
"name":"Facebook",
"version":"1.0",
"description":"My Facebook Profile",
"manifest_version":2,
"browser_action":{
"default_icon":"google-plus-red-128.png",
"default_popup":"hello.html"
}
}
Run Code Online (Sandbox Code Playgroud)
这是html页面的代码
<!DOCTYPE html>
<html>
<head>
<script>
var a=0;
function count()
{
a++;
document.getElementById("demo").innerHTML=a;
return a;
}
</script>
</head>
<body>
<p id="demo">=a</p>
<button type="button" onclick="count()">Count</button>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我希望扩展程序向我显示a的值,并在每次单击扩展名或按钮时将其递增1
javascript google-chrome button google-chrome-extension content-security-policy