惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
T
The Exploit Database - CXSecurity.com
The GitHub Blog
The GitHub Blog
量子位
S
SegmentFault 最新的问题
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Proofpoint News Feed
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
Threat Research - Cisco Blogs
I
Intezer
Hugging Face - Blog
Hugging Face - Blog
Spread Privacy
Spread Privacy
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
Know Your Adversary
Know Your Adversary
人人都是产品经理
人人都是产品经理
G
Google Developers Blog
Cyberwarzone
Cyberwarzone
L
LINUX DO - 热门话题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Tenable Blog
Jina AI
Jina AI
A
About on SuperTechFans
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MyScale Blog
MyScale Blog
AWS News Blog
AWS News Blog
宝玉的分享
宝玉的分享
WordPress大学
WordPress大学
T
Threatpost
大猫的无限游戏
大猫的无限游戏
I
InfoQ
T
Tor Project blog
Project Zero
Project Zero
F
Full Disclosure
L
Lohrmann on Cybersecurity
P
Palo Alto Networks Blog
G
GRAHAM CLULEY
B
Blog
Apple Machine Learning Research
Apple Machine Learning Research
The Hacker News
The Hacker News
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
V
V2EX
The Cloudflare Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security

博客园 - chuncn

Eslint 规则说明 磁盘阵列RAID原理、种类及性能优缺点对比 JavaScript中的CSS属性对照表 webRTC-实时流媒体的福音 qt 5.1 quick vs qt 4.x quick for control zeroc ice的概念、组成与服务 国内外期货、外汇、股指期货 交易时间 使用Visual Leak Detector for Visual C++ 捕捉内存泄露 window8 metro 之 RSA sqlite in qt Windows环境下使用Boost Qt 表格&列表数据驱动化(c++) 原创 Qt读写INI配置文件 Qt多国语言的实现与切换(国际化) Qt编码风格 -- 转 win32里玩事件-转 c++中捕捉内存泄露、异常 win32 http download win32 DirectUI控件开发与调用指南
asp.net中调用命令行
chuncn · 2016-09-16 · via 博客园 - chuncn

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1" %>
<%@ Import Namespace="System.Diagnostics" %>
<script runat="server">
protected override void OnInit(EventArgs e)
{
string filePath = @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe";
string param = @" E:\Dev\CNBlogsJob.sln /p:Configuration=release";

filePath = "notepad.exe";
param = "";

//以release方式编译CNBlogsJob.sln
ProcessStartInfo info = new ProcessStartInfo(filePath, param);
//将控制台输出重定向至StandardOutput,如果为false,就无法得到控制台输出结果
info.RedirectStandardOutput = true;
info.UseShellExecute = false;
Process p = Process.Start(info);
//下面一行代码是为了模拟控制台的显示效果
Response.Write("<body style=\"color:#DDD;background-color:#000;\">");
//控制台输出结果
Response.Write(p.StandardOutput.ReadToEnd().Replace("\n","<br/>"));
Response.Write("</body>");
p.WaitForExit();
p.Close();
}
</script>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>