草庐IT

no_such_process

全部标签

c# - 琐事多于真正重要 : Why no new() constraint on Activator. CreateInstance<T>()?

我想有人可以回答这个问题,这是出于好奇而提出的问题:System.Activator中的通用CreateInstance方法在.NETv2中引入,对通用参数没有类型限制,但确实需要激活类型的默认构造函数,否则将抛出MissingMethodException。对我来说,很明显这个方法应该有一个类型约束,比如Activator.CreateInstance()whereT:new(){...}这里只是一个遗漏还是一些轶事?更新如前所述,编译器不允许你这样写privateTCreate()whereT:struct,new()errorCS0451:The'new()'constraint

c# - "There is no editor available for"无法打开.cs

我的电脑在处理一个项目时关机,当我再次打开C#并恢复它时,我收到一条错误消息Thereisnoeditoravailable'forfilename.cs'Makesuretheapplicationforthefiletype(.cs)isinstalled现在我根本无法访问我的代码。我正在使用VisualC#2010Express。我尝试直接打开它,它显示了C#,但.cs文件在记事本中打开。文件大小为30kb,所以它没有被删除。并且在上次运行的调试文件夹中仍然有一个工作的.exe。有什么方法可以恢复代码吗? 最佳答案 尝试在记事

c# - Process.StartInfo.Arguments 是否支持 UTF-8 字符串?

可以使用UTF-8字符串作为StartInfo的参数吗?我正在尝试将UTF-8(在本例中为日语字符串)作为控制台参数传递给应用程序。类似这样的东西(这只是一个例子!(cmd.exe将是一个自定义应用程序))varprocess=newSystem.Diagnostics.Process();process.StartInfo.Arguments="/K\"echoこれはテストです\"";process.StartInfo.FileName="cmd.exe";process.StartInfo.UseShellExecute=true;process.Start();process.W

c# - asp.net下的Process.Start()?

根据msdn:ASP.NETWebpageandservercontrolcodeexecutesinthecontextoftheASP.NETworkerprocessontheWebserver.IfyouusetheStartmethodinanASP.NETWebpageorservercontrol,thenewprocessexecutesontheWebserverwithrestrictedpermissions.Theprocessdoesnotstartinthesamecontextastheclientbrowser,anddoesnothaveaccesst

c# - 从 Windows 服务调用时,Process.Start 不起作用

在Windows8上,我正在运行一个Windows服务。该服务应该通过启动一个程序Process.Start(exePath);但是进程会立即退出——甚至Main过程中的第一行也不会执行。以前,在Windows7上的相同服务中运行相同进程时,一切正常。如何让它重新工作?如何从Windows服务正确启动进程? 最佳答案 找到解决方案。流程必须像这样开始:ProcessStartInfoinfo=newProcessStartInfo(exePath);info.CreateNoWindow=true;info.UseShellExec

c# - SOAP 错误 : "Server was unable to process request" "Object reference not set to an instance of an object"

当我向本地IIS中的服务发送SOAP请求时,一切正常。当我向在另一台主机上的IIS上运行的同一服务发送SOAP请求时,一切正常。但是当另一个程序员向我的服务发送SOAP请求时,他通常会得到正确的响应,除了返回服务中的一个方法:soap:ServerServerwasunabletoprocessrequest.--->Objectreferencenotsettoaninstanceofanobject.我需要了解他收到此错误的原因。他的SOAP请求与SOAP请求完全相同,但我的有效,而他的无效。 最佳答案 如果您不确切知道错

c# - 为什么即使进程确实存在,Process.WaitForExit 也会抛出 "no process"异常?

我有一个包含此代码的Windows服务:publicstaticvoidExtractTextInner(stringsource,stringdestination){ProcessStartInfostartInfo=newProcessStartInfo();startInfo.FileName=EXTRACTOR_EXE_FILEPATHstartInfo.Arguments="\""+source+"\"\""+destination+"\"";startInfo.CreateNoWindow=true;startInfo.WindowStyle=ProcessWindowS

c# - 在什么情况下 Process.Start() 方法会返回 false?

来自MSDN:Thereturnvaluetrueindicatesthatanewprocessresourcewasstarted.IftheprocessresourcespecifiedbytheFileNamememberoftheStartInfopropertyisalreadyrunningonthecomputer,noadditionalprocessresourceisstarted.Instead,therunningprocessresourceisreusedandfalseisreturned.尝试这样的事情:varinfo=newProcessStart

C# Process.MainWindowHandle 总是返回 IntPtr 零

这是我的代码:using(Processgame=Process.Start(newProcessStartInfo(){FileName="DatabaseCheck.exe",RedirectStandardOutput=true,CreateNoWindow=true,UseShellExecute=false})){lblLoad.Text="Loading";intSwitch=0;while(game.MainWindowHandle==IntPtr.Zero){Switch++;if(Switch%1000==0){lblLoad.Text+=".";if(lblLoad

c# - process.standardoutput.ReadToEnd() 总是空的?

我正在启动一个控制台应用程序,但是当我重定向标准输出时,我总是什么也得不到!当我不重定向它,并将CreateNoWindow设置为false时,我在控制台中正确地看到了所有内容,但是当我重定向它时,StandardOutput。ReadToEnd()始终返回一个空字符串。Processcproc=newProcess();cproc.StartInfo.CreateNoWindow=true;cproc.StartInfo.FileName=Dest;cproc.StartInfo.RedirectStandardOutput=true;cproc.StartInfo.WindowSt