create procedure dbo.sp_spidtoip @spid int
as -- spid to mac
-- lj
declare @mac as varchar(12)
select @mac = ***_address from master..sysprocesses where spid = @spid
-- mac to ip
declare @macdisplay as varchar(18)
declare @ip as varchar(15)
create table #temp (output varchar(255) null)
set nocount on
insert into #temp exec master..xp_cmdshell 'arp -a'
if @@error<>0
begin
raiserror ('the level for job_id:%d should be between %d and %d.', 16, 1)
--rollback transaction
end
select @macdisplay = left(@mac, 2) + '-' + substring(@mac, 3, 2) + '-' + substring(@mac, 5, 2) + '-' + substring(@mac, 7, 2) + '-' + substring(@mac, 9, 2) + '-' + substring(@mac, 11, 2) select @ip = substring(output, 3, 15) from #temp where output like '%' + @macdisplay + '%'
-- resolve the ip
--declare @cmd as varchar(100)
--select @cmd = 'master..xp_cmdshell "ping -a ' + @ip + '"'
--exec (@cmd)
drop table #temp
set nocount off
go
charles 客戶端程序
本文參考 charles 客戶端程序 客戶端程序工具 client process 顯示使每個請求的本地客戶端程序 客戶端程序工具顯示負責進行每個請求的本地客戶端程序的名稱。客戶端程序通常是您的web瀏覽器,例如firefox.exe,但客戶端程序工具可以幫助您發現許多可能未知的http客戶端。客戶...
如何根據程序id獲取該程序的主視窗控制代碼
最近剛好有個功能,需要這個邏輯,話不多說,上 struct handle data bool ismainwindow hwnd handle hwnd findmainwindow unsigned long process id bool callback enumwindowscallback...
根據程序號獲取程序路徑函式(原創)
這個問題在論壇上被很多人問過,我這裡寫個函式,公開源 對應csdn論壇帖子為 源 private declare function openprocess lib kernel32.dll byval dwdesiredaccess as long,byval binherithandle as l...