Asp.netµ÷ÓÃRARѹËõÎļþÓë½âѹÎļþÔ´Âë
//ѹËõ
protected void btnY_Click(object sender, EventArgs e)
{
string rar;
RegistryKey reg;
string args;
ProcessStartInfo procStart;
Process process;
try
{
reg = Registry.ClassesRoot.OpenSubKey(@"Applications\WinRAR.exe\Shell\Open\Command");
rar = reg.GetValue("").ToString();//»ñȡע²á±írar°²×°Â·¾¶
reg.Close();
rar = rar.Substring(1, rar.Length - 7);//»ñÈ¡rar°²×°Â·¾¶
args = "a -inul -y G:\\temp.rar G:\\1.txt";//ÕâÀïΪrarµÄѹËõÃüÁî¸ñʽ£¨Ò²¿ÉÒÔ×ÔÐÐÀ©Õ¹£©
procStart = new ProcessStartInfo();
procStart.FileName = rar;
procStart.Arguments = args;//²ÎÊý
procStart.WindowStyle = ProcessWindowStyle.Hidden;//´°¿Ú״̬
procStart.WorkingDirectory = Server.MapPath(""); ;//»ñÈ¡»òÉèÖÃÒªÆô¶¯µÄ½ø³ÌµÄ³õʼĿ¼¡£
process = new Process();
process.StartInfo = procStart;
process.Start();
Response.Write("<script>alert('ѹËõ³É¹¦')</script>");
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}
//½âѹ
protected void btnJ_Click(object sender, EventArgs e)
{
string rar;
RegistryKey reg;
string args;
ProcessStartInfo startInfo;
Process process;
try
{
reg = Registry.ClassesRoot.OpenSubKey(@"Applications\WinRar.exe\Shell\Open\Command");
rar = reg.GetValue("").ToString();
reg.Close();
rar = rar.Substring(1, rar.Length - 7);
args = " X E:\\temp.rar E:\\";
startInfo = new ProcessStartInfo();
startInfo.FileName = rar;
startInfo.Arguments = args;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
process = new Process();
process.StartInfo = startInfo;
process.Start();
Response.Write("<script>alert('½âѹ³É¹¦')</script>");
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}
Àý:°Ñ
Ïà¹ØÎĵµ£º
֮ǰҪÍê³ÉÒ»¸öÖ§³Ö¶àÖ§³Ö¶àÖÖ¸ñʽµÄÊÓƵ²¥·ÅÆ÷£¬ÔÚÍøÉÏÕÒµ½Ò»¸öVBдµÄ£¬È»ºó¸Ä³ÉC#£¬½ü¶ÎÔÚÍøÉÏÒ²¼ûÓв»ÉÙÈËÎÊÕâ¸öÎÊ£¬ÔÚ´Ë·ÖÏí
public class VideoPlayer
{
/// <summary>
/// Éú³ÉÊÓƵ²¥·ÅÆ÷µÄHTM ......
VS ASP.NETÉèÖöϵã ÎÞ·¨µ÷ÊÔ
ÎҵĿª·¢¹¤¾ßVS2005 IEä¯ÀÀÆ÷ÊÇ8.0£¬ÉèÖöϵãÖ®ºó²»Äܵ÷ÊÔ¡£
Ò»°ã»áÓÐÁ½ÖÖ¿ÉÄÜ£º
Ò»¡¢web.config debugÊôÐÔÉèÖÃΪTRUE
<compilation debug="true" />
¶þ¡¢IE8µÄÎÊÌâ
ÐÞ¸Ä×¢²á±í£ºHKEY_LOCALMACHINE -> SOFTWARE -> Microsoft -> Internet Explorer -> Main
ÐÂÔöÃû³ ......
1 ÈçºÎÔÚÌá½»ºó·ÀÖ¹µ¯³öд°¿Ú
2 ÔÚģ̬´°¿ÚÖÐÔٴε¯³öģ̬´°¿Ú
3 ģ̬´°¿Ú·µ»ØÖµ
4 ˢи¸´°¿Ú
5 ¸¸´°¿ÚÈçºÎÌí¼Óˢнű¾
Ö÷´°¿Úµ¯³öÒ»¸öģ̬´°¿Ú,
var firstDiag = window.showModalDialog(url,window,"center:yes;dialogWidth:300px;dialogHeight:400px");
×¢:ÔÚurlÎļþµÄhead¼ÓÈë <base target='_self'> ¾ ......
ÆäʵËùνµÄα¾²Ì¬Ò³Ãæ,¾ÍÊÇÖ¸µÄURLÖØд.
1.Ê×ÏÈÔÚweb.configÀïд
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
</configSections>
2.ÔÚweb.configÀïÌí¼ÓÒÔϽڵã
<httpHandlers>
< ......
ÍøÉÏÕÒµ½µÄÒ»¸ö°ì·¨£¬Ò²¿ÉÒÔ½â¾ö Óûسµ¼ü´úÌæÌá½»°´Å¥Ê±£¬Óû§³£°´»Ø³µ£¨·Ç³£¿ìËٵĵã»Ø³µ£©µ¼ÖÂÖظ´Ìá½»µÄÇé¿ö£º
public class SubmitOncePage : System.Web.UI.Page
{
private string _strSessionKey;
&n ......