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

推荐订阅源

S
Secure Thoughts
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Heimdal Security Blog
SecWiki News
SecWiki News
H
Hacker News: Front Page
N
News | PayPal Newsroom
L
LINUX DO - 最新话题
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
AI
AI
C
Cybersecurity and Infrastructure Security Agency CISA
Scott Helme
Scott Helme
PCI Perspectives
PCI Perspectives
S
Securelist
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Cyberwarzone
Cyberwarzone
A
Arctic Wolf
Forbes - Security
Forbes - Security
T
Tor Project blog
Spread Privacy
Spread Privacy
WordPress大学
WordPress大学
I
Intezer
Martin Fowler
Martin Fowler
Help Net Security
Help Net Security
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Cisco Talos Blog
Cisco Talos Blog
Latest news
Latest news
博客园 - 司徒正美
W
WeLiveSecurity
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
P
Palo Alto Networks Blog
Google DeepMind News
Google DeepMind News
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
V
Vulnerabilities – Threatpost
Jina AI
Jina AI
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
Simon Willison's Weblog
Simon Willison's Weblog
Project Zero
Project Zero
T
Threatpost
P
Privacy International News Feed
人人都是产品经理
人人都是产品经理
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - 范燕军

UML学习之用例图 jquery分页控件 对象,XML序列化 (转)C#中调用Windows API时的数据类型对应关系 asp.net页生命周期 SVN服务端的配置 [ 转] .NET相关的最好东西--全球最新评价 [转] 用ASP.NET对IIS中的虚拟目录进行操作 [转] 使用JavaScript检测浏览器的相关特性 [转] 路径,文件,目录,I/O常见操作汇总(三) [转] 路径,文件,目录,I/O常见操作汇总(二) [转] 路径,文件,目录,I/O常见操作汇总(一) [转]NET用户控件文件上传,并给图片文件加水印(增加文字水印文字设置) [转] Javascript访问Cookie的四个常用方法 [转] Javascript访问Cookie的四个常用方法 [转]C#实现MS SQL数据导出到Excel [转]常用的JavaScript验证正则表达式 [转]ajax加载内容示例 [转]14 个经典的javascript代码
asp.net执行.sql文件
范燕军 · 2008-04-02 · via 博客园 - 范燕军

//应用Process前请引用:System.Diagnostics命名空间.
   string infile=System.Web.HttpContext.Current.Server.MapPath("test.sql");
   Process sqlprocess=new Process();
   sqlprocess.StartInfo.FileName="osql.exe";
   sqlprocess.StartInfo.Arguments=String.Format("-U {0} -P {1} -S {2} -i {3}","sa","123456","192.168.0.28",@infile); //U为用户名,P为密码,S为目标服务器的ip,infile为数据库脚本所在的路径
   sqlprocess.StartInfo.WindowStyle=ProcessWindowStyle.Hidden;
   sqlprocess.Start();
   sqlprocess.WaitForExit(); //等待程序执行.Sql脚本
   sqlprocess.Close();
   Response.Write("<script>alert('Ok.');</script>");

posted on 2008-04-02 16:42  范燕军  阅读(322)  评论()    收藏  举报