本文介绍了从ASP.Net运行Dos命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我用C#脚本在ASP.Net中创建了一个页面,通过该页面可以启动VLC播放器并将在线音频流传输到本地IP地址.这是我在VS 2005中开发的,运行良好.我对VS 2008 SP1的项目,该过程开始了,我可以在任务管理器中看到该过程,但是似乎VLC播放器没有按预期方式进行流式传输.请找到下面的代码.

Hi,
   I Created a page in ASP.Net with C# scripting through which one can start VLC player and stream online audios to local IP address.This i developed in VS 2005 which was working fine.when i migrated my project to VS 2008 SP1,the process starts which i can see in the task manager, but seems the VLC player is not streaming as expected.Please find the code below.

 

字符串 cmd;

cmd =

string cmd;

cmd =

" VLC http://asx. abacast.com/arabian_radio-city-24.asx:sout =#transcode {acodec = wma,ab = 128,channels = 2}:duplicate {dst = std {access = mmsh,dst = localhost:1234}}:sout-全部:sout-keep" + "\ n \ r" ;

"VLC http://asx.abacast.com/arabian_radio-city-24.asx :sout=#transcode{acodec=wma,ab=128,channels=2}:duplicate{dst=std{access=mmsh,dst=localhost:1234}} :sout-all :sout-keep" + "\n\r";

 

ProcessStartInfo si = ProcessStartInfo ( "cmd.exe" );

ProcessStartInfo si = new ProcessStartInfo("cmd.exe");

 

//重定向两个流,以便我们可以编写/阅读它们.

si.RedirectStandardInput =

si.RedirectStandardInput =

;

si.RedirectStandardOutput =

true;

si.RedirectStandardOutput =

;

si.UseShellExecute =

true;

si.UseShellExecute =

false ;

false;

 

//开始处理.

处理 p = 处理 .Start(si);

Process p = Process.Start(si);

 

字符串 sId = p.Id.ToString();

string sId = p.Id.ToString();

 

//发出dir命令.

p.StandardInput.WriteLine(

p.StandardInput.WriteLine(

@"cd \" );

p.StandardInput.WriteLine(

@"cd\");

p.StandardInput.WriteLine(

@"cd C:\ Program Files \ VideoLan \ VLC"; );

线程 .Sleep(5000);


,但是当我通过窗口应用程序项目(VS 2008 SP1)执行相同的代码时,它的工作正常.


似乎是一些赠款问题.请帮帮我.

注意:我已向所有人授予对安装VLC播放器的C:驱动器的完全许可.

感谢与问候,
Varadharaj.G

p.Kill();

p.Kill();

p.StandardInput.WriteLine(cmd);

p.StandardInput.WriteLine(cmd);

推荐答案

感谢您的帖子!我建议将您的问题发布到首页


这篇关于从ASP.Net运行Dos命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 17:42