C#中怎么调用iisapp.vbs

发布时间:2021-07-07 16:57:14 作者:Leah
阅读:189
开发者专用服务器限时活动,0元免费领! 查看>>

C#中怎么调用iisapp.vbs,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。

C#调用iisapp.vbs代码:

  1. usingSystem;  

  2. usingSystem.Text;  

  3. usingSystem.Text.RegularExpressions;  

  4. usingSystem.Diagnostics;  

  5. usingSystem.Management;  

  6. usingSystem.Windows.Forms;  

  7. namespaceTextConvertor  

  8. {  

  9. /**////<summary> 

  10. ///W3wp的摘要说明。  

  11. ///</summary> 

  12. publicclassW3wp  

  13. {  

  14. privateW3wp(){}  

  15. publicstaticstringGetAllW3wp(stringinput)  

  16. {  

  17. ObjectQueryoQuery=newObjectQuery
    ("select*fromWin32_ProcesswhereName='w3wp.exe'");  

  18. ManagementObjectSearcheroSearcher=newManagementObjectSearcher(oQuery);  

  19. ManagementObjectCollectionoReturnCollection=oSearcher.Get();  

  20. stringpid;  

  21. stringcmdLine;  

  22. StringBuildersb=newStringBuilder();  

  23. foreach(ManagementObjectoReturninoReturnCollection)  

  24. {  

  25. pid=oReturn.GetPropertyValue("ProcessId").ToString();  

  26. cmdLine=(string)oReturn.GetPropertyValue("CommandLine");  

  27. stringpattern="-ap\"(.*)\"";  

  28. Regexregex=newRegex(pattern,RegexOptions.IgnoreCase);  

  29. Matchmatch=regex.Match(cmdLine);  

  30. stringappPoolName=match.Groups[1].ToString();  

  31. sb.AppendFormat("W3WP.exePID:{0}AppPoolId:{1}\r\n",pid,appPoolName);  

  32. }  

  33. returnsb.ToString();  

  34. }  

  35. }  

关于C#中怎么调用iisapp.vbs问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注亿速云行业资讯频道了解更多相关知识。

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

推荐阅读:
  1. C#中怎么调用OpenCV
  2. C#中的方法如何调用

开发者交流群:

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

iisapp.vbs

上一篇:centos 怎么安装 nginx

下一篇:centos用docker方式安装redis

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》
开发者交流群×