易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net调用bat文件

引用命名空间
using System.Diagnostics;
                string sPath = "d:\\test\\test.bat";
string sDict = "d:\\test\\";
ProcessStartInfo psi = new ProcessStartInfo("cmd.exe");
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardInput = true;
psi.RedirectStandardError = true;
psi.Arguments = sPath;
psi.WorkingDirectory = sDict;
// Start the process
System.Diagnostics.Process proc = System.Diagnostics.Process.Start(psi);
// Attach the output for reading
System.IO.StreamReader sOut = proc.StandardOutput;
proc.Close();
// Read the sOut to a string.
string results = sOut.ReadToEnd().Trim();
sOut.Close();
// Write out the results.
string fmtStdOut = "<font face=courier size=0>{0}</font>";
this.Response.Write(String.Format(fmtStdOut, results.Replace(System.Environment.NewLine, "<br />")));


相关文档:

asp.net treeview绑定数据库,并取节点和节点的内容

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using AlltripDLL;
public pa ......

ASP.NET中Excel: Access is denied的问题解决

在ASP.NET中调用EXCEL组件的时候,如果没有配置DCOM中EXCEL权限问题,结果程序会报:Access is denied.
解决的方法有两种:
第一种,在web.config中设置一个节点.
 <identity impersonate="true" />
不过这种方法只能解决local电脑上的Excel Access is denied的问题
如果是服务器的话,有客户机访问页面的时候, ......

asp.net动态注册javascript总结

一.使用RegisterStartUpScript注册只执行一次的javascript
第1步(创建并注册并使用javascript):Page.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
//创建JavaScript
string info = "<mce:script type="text/javascript"><!--alert('你好,我是XXX!')// --></mce:scrip ......

asp.net生成静态页面

public static void GetHtml(string url,string savepath)//url参数为将要生成的那个动态页面的地址,savepath为要存放地址
{
string Result;
WebResponse MyResponse;
WebRequest MyRequest = System.Net.HttpWebRequest.Create(url);
MyResponse = MyReque ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号