2016-05-16 84 views
0

我在用户系统中创建了一个注册表。我想当用户点击我的图像按钮,在我的GridView。我将从注册中心调用url协议并执行Explorer.exe,我将使用网格上的图像按钮分配路径。调用explore.exe与aspx页面的路径

我创建的注册表,低于

Windows Registry Editor Version 5.00 

[HKEY_CLASSES_ROOT\PicPath] 
@="URL: MPath Protocol" 
"URL Protocol"="" 

[HKEY_CLASSES_ROOT\PicPath\shell] 

[HKEY_CLASSES_ROOT\PicPath\shell\open] 

[HKEY_CLASSES_ROOT\PicPath\shell\open\command] 
@="\"C:\\Windows\\explorer.exe\"" 

的问题是,当我添加 @="\"C:\\Windows\\explorer.exe\ " "%1

%1是参数当我通过我的c:\Logs系统启动任务栏打开无限的探险家。但是,当我使用@="\"C:\\Windows\\explorer.exe\""它的开放探索完美的客户端系统。但我希望explorer.exe在客户端系统上打开特定路径。下面

是我的代码,我尝试

protected void grdOrderList_RowDataBound(object sender, GridViewRowEventArgs e) 
{ 
    HtmlAnchor a = new HtmlAnchor(); 
    a.HRef = "MPath:OpenForm " + "/root,C:\\Abc"; 
    a.ID = "a1"; 

    System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image(); 
    img.ID = "img1"; 

    img.Visible = true; 
    img.ImageUrl = @"~\images\blue_camera.png"; 
    a.Controls.Add(img); 
    e.Row.Cells[0].Controls.Add(a); 
} 

所以,我怎么能做到这一点。谢谢你的时间

回答

-1
protected void grdOrderList_RowDataBound(object sender, GridViewRowEventArgs e) 
{ 
    HtmlAnchor a = new HtmlAnchor(); 
    a.HRef = "MPath:OpenForm " + "/root,C:\\Abhishek"; 
    a.ID = "a1"; 

    //System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image(); 
    //img.ID = "img1"; 

    //img.Visible = true; 
    //img.ImageUrl = @"~\images\blue_camera.png"; 

    var img = new ImageButton(); 
    img.Click += new ImageClickEventHandler(img_Click); 
    a.Controls.Add(img); 
    e.Row.Cells[0].Controls.Add(a); 
} 

protected void img_Click(object sender, ImageClickEventArgs e) 
{ 
    System.Diagnostics.Process.Start(@"c:\blah.txt"); 
} 
+1

'IExplore'是_Internet_ explorer不是_Windows_ explorer。 –

+0

@davidarnol process.Start将运行在服务器端而不是客户端 –