1.ipconfig Դ?源码?
2.WinPE上网程序设置
ipconfig Դ??
1.得到局域网网段,可由自己机器的源码IP来确定 (也可以手动获取主机IP-CMD-ipconfig /all)
2.根据IP类型,一次遍历局域网内IP地址
JAVA类,源码编译之后直接运行便可以得到局域网内所有IP,源码具体怎样使用你自己编写相应代码调用便可
代码如下::
package bean;
import java.io.*;
import java.util.*;
public class Ip{
static public HashMap ping; //ping 后的结果集
public HashMap getPing(){ //用来得到ping后的结果集
return ping;
}
//当前线程的数量, 防止过多线程摧毁电脑
static int threadCount = 0;
public Ip() {
ping = new HashMap();
}
public void Ping(String ip) throws Exception{
//最多个线程
while(threadCount>)
Thread.sleep();
threadCount +=1;
PingIp p = new PingIp(ip);
p.start();
}
public void PingAll() throws Exception{
//首先得到本机的源码单词游戏源码androidIP,得到网段
InetAddress host = InetAddress.getLocalHost();
String hostAddress = host.getHostAddress();
int k=0;
k=hostAddress.lastIndexOf(“.”);
String ss = hostAddress.substring(0,源码ysql源码怎么查k+1);
for(int i=1;i <=;i++){ //对所有局域网Ip
String iip=ss+i;
Ping(iip);
}
//等着所有Ping结束
while(threadCount>0)
Thread.sleep();
}
public static void main(String[] args) throws Exception{
Ip ip= new Ip();
ip.PingAll();
java.util.Set entries = ping.entrySet();
Iterator iter=entries.iterator();
String k;
while(iter.hasNext()){
Map.Entry entry=(Map.Entry)iter.next();
String key=(String)entry.getKey();
String value=(String)entry.getValue();
if(value.equals(“true”))
System.out.println(key+“-->”+value);
}
}
class PingIp extends Thread{
public String ip; // IP
public PingIp(String ip){
this.ip=ip;
}
public void run(){
try{
Process p= Runtime.getRuntime()。exec (“ping ”+ip+ “ -w -n 1”);
InputStreamReader ir = new InputStreamReader(p.getInputStream());
LineNumberReader input = new LineNumberReader (ir);
//读取结果行
for (int i=1 ; i <7; i++)
input.readLine();
String line= input.readLine();
if (line.length() < || line.substring(8,源码)。equals(“timed out”))
ping.put(ip,源码“false”);
else
ping.put(ip,“true”);
//线程结束
threadCount -= 1;
}catch (IOException e){ }
}
}
}
WinPE上网程序设置
网启服务器自动配置程序:
@echo off
PUSHD %~dp0
SET TP=%CD%
Title HaneWin网启服务端 通用免配程序 for winPE_xp__win7
rem ==========以下此行为启动引导文件,请自行修改,源码 必须在分区根目录=======
set bootfile=PXEgrldr.0
rem ==========================================================
echo 正在自动搜索启动文件,可能需要一些时间,源码请稍等。源码。源码。源码zippo追踪货源码
set BaseDirectory=
set bootdrver=%~d0
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:%bootfile% set bootdrver=%%i:
if not exist %bootdrver%%bootfile% ECHO 找不到网启文件:%bootfile% pause exit
set BaseDirectory=%bootdrver%
rem if exist %bootdrver%%bootfile% set BaseDirectory=%bootdrver%goto copyfile
rem for /f "usebackq" %%i in (`dir "%bootdrver%%bootfile%" /s/b`) do set BaseDirectory=%%~dpi
rem if %BaseDirectory%.==. echo 在 %bootdrver%盘上 找不到启动文件:%bootfile% pause
:copyfile
copy DHCP*.* %temp% /y nul
set tp=%temp%
%TP%dhcp4nt.exe -remove nul
setlocal
set/a a=-2
for /f "usebackq tokens=2 delims=:" %%i in (`ipconfig`) do (
set b=%%i
call :getip
)
for /f "tokens=1-3,源码4 delims=." %%i in ("%_myip%") do set IP_Pool=%%i.%%j.%%k.
%TP%DHCPsrv.ini echo.[License]
%TP%DHCPsrv.ini echo.Key=BBLZUBBCAT9
%TP%DHCPsrv.ini echo.Name=Free User
%TP%DHCPsrv.ini echo.[DHCPsrv]
%TP%DHCPsrv.ini echo.Profile0=本地连接
%TP%DHCPsrv.ini echo.TFTPDirectory=%BaseDirectory%
%TP%DHCPsrv.ini echo.Multicast=0
%TP%DHCPsrv.ini echo.TFTPEnable=1
%TP%DHCPsrv.ini echo.TFTPPort=
%TP%DHCPsrv.ini echo.TFTPMode=0
%TP%DHCPsrv.ini echo.Log=0
%TP%DHCPsrv.ini echo.TestIP=1
%TP%DHCPsrv.ini echo.ChangeIP=1
%TP%DHCPsrv.ini echo.EnableMAC=1
rem 有多个网卡时,如不能确定那个网卡,源码可以将下面此行去掉
%TP%DHCPsrv.ini echo.Include=%_myip%
%TP%DHCPsrv.ini echo.[本地连接]
%TP%DHCPsrv.ini echo.SubnetMask=%_mask%
%TP%DHCPsrv.ini echo.BaseIP=%IP_Pool%
%TP%DHCPsrv.ini echo.Range=
%TP%DHCPsrv.ini echo.BootFile=%bootfile%
%TP%DHCPsrv.ini echo.GatewayIP=%_Gateway%大白菜官网
%TP%DHCPsrv.ini echo.InterfaceIP=%_myip%
endlocal
%tp%dhcp4nt.exe -install nul
start %tp%dhcpsrv.cpl
if not exist x:*.* goto windows
PECMD.EXE LINK %%Programs%%网络工具网启服务器HaneWin网启服务端,%tp%dhcpsrv.cpl,,%tp%dhcp.ico
PECMD.EXE LINK %%Programs%%网络工具网启服务器开启HaneWin网启服务,%tp%dhcp4nt.exe,-install,shell.dll#
PECMD.EXE LINK %%Programs%%网络工具网启服务器关闭HaneWin网启服务,%tp%dhcp4nt.exe,-remove,shell.dll#
PECMD FILE "%%DESKTOP%%开启HaneWin网启服务端.*"
rem 删除共享名PEroot,建立共享名为PEROOT,共享资源为%BaseDirectory%
PECMD EXEC CMD /C "net share PEROOT /d"
PECMD EXEC CMD /C "net share PEROOT=%BaseDirectory% /unlimited"
rem PECMD FIND EXPLORER.EXE,三板源码KILL EXPLORER.EXE
echo.
echo 已将本机PE系统 [url=file://%Computername%PEROOT]%Computername%PEROOT[/url] 共享给远程客户(主机名:%Computername%,用户名:Guest,密码为空)
:windows
echo.
echo.
echo 远程启动网启服务器.启动成功!可以进行远程网络启动PE!
echo.
pause
EXIT
:getip
set /a a=%a%+1
if %a%==1 set _myip=%b%
if %a%==2 set _mask=%b%
if %a%==3 set _Gateway=%b%
goto :eof
===================================================================================
@ECHO OFF
Title HaneWin网启服务端_映射远程主机 免配程序 for winPE
PUSHD %~dp0
set tp=%cd%
rem 第一次运行
pecmd.exe IFEX %%Desktop%%映射远程主机.LNK,!EXEC cmd /c copy "%tp%网启快捷及映射主机.CMD" "%tp%映射远程主机.TMP"
PECMD.exe LINK %%Desktop%%映射远程主机,%tp%网启快捷及映射主机.CMD,,SHELL.DLL#
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:PEToolswin7.ini PECMD.exe file %%Desktop%%映射远程主机.
*for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:外置程序winPE.ini PECMD.exe file %%Desktop%%映射远程主机.
*pecmd.exe IFEX %%Desktop%%映射远程主机.LNK,!EXEC cmd /c copy "%tp%网启快捷及映射主机.CMD" "%tp%映射远程主机.TMP"
if exist "%tp%映射远程主机.TMP" goto end
rem 映射远程主机
ipconfig /all |find /i "DHCP" |find /i "服务器"%temp%ip.txt
ipconfig /all |find /i "DHCP" |find /i "Server"%temp%ip.txt
for /f "usebackq tokens=2 delims=:" %%i in (%temp%ip.txt) do (
set ip=%%i
)
set ip=%ip:~1%
ECHO.
ECHO 将远程服务器%ip%的共享名peroot 映射为本地Z:盘,主要是用于客户端,用户Guest,密码为空)
ECHO .
ECHO .
ECHO 正在连接至远程服务器:%ip%, 请稍等。。xcode怎么添加源码。。。。
ECHO.|NET USE z: [url=file://%ip%PEROOT]%ip%PEROOT[/url] /user:guest /persistent:no
pecmd wait
if exist z:*.* PECMD.EXE MESS 网络成功连接,并已连接远程服务器为Z:nnn如不能连上InterNet网,请在网络设置中释放-更新络IP,或在服务器上关闭网络启动服端!@提示 #ok
*if exist z:PETOOLSWin7.INI PECMD.EXE LINK %%Desktop%%加载远程外置程序1,PECMD.EXE,LOAD z:PETOOLSWin7.INI,Shell.dll#
if exist z:外置程序winPE.ini PECMD.EXE LINK %%Desktop%%加载远程外置程序2,PECMD.EXE,LOAD z:外置程序winPE.ini,Shell.dll#
if not exist z:*.* PECMD.EXE MESS 无法连接远程服务器,请检查网络或服务器!!@提示 #ok
*:end
pecmd.exe file "%tp%映射远程主机.TMP"
pecmd.exe file "%tp%映射远程主机.TMP"
pecmd.exe IFEX %%Desktop%%映射远程主机.LNK,!LINK %%Programs%%网络工具网启服务器HaneWin网启服务端,%tp%HaneWin网启服务端.CMD,,%tp%DHCP.ICO
exit
这段源码可以根据自己的需要进行适当修改。
2024-11-18 21:24
2024-11-18 20:13
2024-11-18 19:45
2024-11-18 19:34
2024-11-18 19:32
2024-11-18 19:16
2024-11-18 19:11
2024-11-18 19:00