2016-05-16 24 views
0

私はユーザシステムにレジストリを登録しました。そして、私は私のグリッドビューにある私のイメージボタンをクリックしたいとき。私はレジストリからurlプロトコルを呼び出し、グリッドの画像ボタンで割り当てられるパスをExplorer.exeで実行します。aspxページからのパスでexplore.exeを呼び出してください

私はこの問題は、私が @="\"C:\\Windows\\explorer.exe\ " "%1

% 1を追加したとき、私はタスクバーに無限のエクスプローラを開くために開始c:\Logs私のシステムを渡すときのパラメータのためのものであることである

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\""を使用すると、クライアントシステム上で完璧に探索できます。しかし、私はその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はクライアント側ではなくサーバー側で実行されます –

関連する問題