代码拉取完成,页面将自动刷新
同步操作将从 azhw/robotgo 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
// Copyright 2016 The go-vgo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// https://github.com/go-vgo/robotgo/blob/master/LICENSE
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
package robotgo
import ps "github.com/vcaesar/gops"
// Nps process struct
type Nps struct {
Pid int32
Name string
}
// Pids get the all process id
func Pids() ([]int32, error) {
return ps.Pids()
}
// PidExists determine whether the process exists
func PidExists(pid int32) (bool, error) {
return ps.PidExists(pid)
}
// Process get the all process struct
func Process() ([]Nps, error) {
var npsArr []Nps
nps, err := ps.Process()
for i := 0; i < len(nps); i++ {
np := Nps{
nps[i].Pid,
nps[i].Name,
}
npsArr = append(npsArr, np)
}
return npsArr, err
}
// FindName find the process name by the process id
func FindName(pid int32) (string, error) {
return ps.FindName(pid)
}
// FindNames find the all process name
func FindNames() ([]string, error) {
return ps.FindNames()
}
// FindIds finds the all processes named with a subset
// of "name" (case insensitive),
// return matched IDs.
func FindIds(name string) ([]int32, error) {
return ps.FindIds(name)
}
// FindPath find the process path by the process pid
func FindPath(pid int32) (string, error) {
return ps.FindPath(pid)
}
// Run run a cmd shell
func Run(path string) ([]byte, error) {
return ps.Run(path)
}
// Kill kill the process by PID
func Kill(pid int32) error {
return ps.Kill(pid)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。