小编van*_*gos的帖子

Eclipse Indigo缺少POM编辑器首选项

我使用eclipse Indigo.我从市场安装(帮助 - > MarketPlace ...)Maven Integration for Eclipse.一切都很好,但是pom编辑器只有几个选项卡(Overview,Depedencies,Depedency Hierarchy,Effective POM,pom.xml).

我去了Window-> Preferences-> Maven,但没有任何POM Editor偏好.(原型,发现,安装,模板,用户界面,用户设置)

有任何想法吗?

eclipse tabs pom.xml

5
推荐指数
1
解决办法
2660
查看次数

减少WMI查询执行时间

在我的应用程序中,我想看看Windows 7是否被激活.要清楚,我不想检查窗户是否是正品.我使用下面的代码,在这里找到http://www.dreamincode.net/forums/topic/166690-wmi-softwarelicensingproduct/

执行查询所需的时间约为5-10秒.反正有没有减少所需的时间?或者另一种检查winows 7是否被激活的方法?

public string VistaOrNewerStatus(){
string status = string.Empty;
string computer = ".";
try
{
    //set the scope of this search
    ManagementScope scope = new ManagementScope(@"\\" + computer + @"\root\cimv2");
    //connect to the machine
    scope.Connect();

    //use a SelectQuery to tell what we're searching in
    SelectQuery searchQuery = new SelectQuery("SELECT * FROM SoftwareLicensingProduct");

    //set the search up
    ManagementObjectSearcher searcherObj = new ManagementObjectSearcher(scope, searchQuery);

    //get the results into a collection
    using (ManagementObjectCollection obj = searcherObj.Get())
    {
        MessageBox.Show(obj.Count.ToString());
        //now loop …
Run Code Online (Sandbox Code Playgroud)

c# wmi-query execution-time

4
推荐指数
1
解决办法
2713
查看次数

C#启动一个进程后,该进程立即退出

我正在尝试从我的应用程序运行一个进程(C#,仅用于Win7),但在许多PC上,进程立即启动和关闭(如任务管理器中所示),而在其他PC上则启动正常.这是我使用的代码:

ProcessStartInfo startInfo = new ProcessStartInfo(@"c:\windows\system32\slui.exe");
startInfo.UseShellExecute = false;
startInfo.Verb = "runas";
Process p = new Process();
p.StartInfo = startInfo;
p.Start();
p.WaitForExit();
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?

c# process

2
推荐指数
1
解决办法
3633
查看次数

标签 统计

c# ×2

eclipse ×1

execution-time ×1

pom.xml ×1

process ×1

tabs ×1

wmi-query ×1