本文实例为大家分享了java常用工具类的具体实现代码,供大家参考,具体内容如下

IP工具类

package com.jarvis.base.util;

import java.io.IOException;

import java.io.InputStreamReader;

import java.io.LineNumberReader;

/**

*

*

* @Title: IpMacUtil.java

* @Package com.jarvis.base.util

* @Description:Ip工具类。

* @version V1.0

*/

public class IpMacUtil {

/**

* 隐藏IP的最后一段

*

* @param ip

* 需要进行处理的IP

* @return 隐藏后的IP

*/

public static String hideIp(String ip) {

if (StringHelper.isEmpty(ip)) {

return "";

}

int pos = ip.lastIndexOf(".");

if (pos == -1) {

return ip;

}

ip = ip.substring(0, pos + 1);

ip = ip + "*";

return ip;

}

/**

* 获取IP地址.

*

* @param request

* HTTP请求.

* @param response

* HTTP响应.

* @param url

* 需转发到的URL.

*/

// public static String getIpAddr(HttpServletRequest request)

// {

// String ip = request.getHeader("x-forwarded-for");

// if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))

// {

// ip = request.getHeader("Proxy-Client-IP");

// }

// if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))

// {

// ip = request.getHeader("WL-Proxy-Client-IP");

// }

// if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))

// {

// ip = request.getRemoteAddr();

// }

// return ip;

// }

/**

* 判断该字串是否为IP

*

* @param ipStr

* IP字串

* @return

*/

public static boolean isIP(String ipStr) {

String ip = "(25[0-5]|2[0-4]\\d|1\\d\\d|\\d\\d|\\d)";

String ipDot = ip + "\\.";

return ipStr.matches(ipDot + ipDot + ipDot + ip);

}

/**

* 获取客户端Mac

*

* @param ip

* @return

*/

public static String getMACAddress(String ip) {

String str = "";

String macAddress = "";

try {

Process p = Runtime.getRuntime().exec("nbtstat -A " + ip);

InputStreamReader ir = new InputStreamReader(p.getInputStream());

LineNumberReader input = new LineNumberReader(ir);

for (int i = 1; i < 100; i++) {

str = input.readLine();

if (str != null) {

if (str.indexOf("MAC Address") > 1) {

macAddress = str.substring(str.indexOf("MAC Address") + 14, str.length());

break;

}

}

}

} catch (IOException e) {

return "";

}

return macAddress;

}

}

File文件工具类

package com.jarvis.base.util;

import java.io.ByteArrayInputStream;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileOutputStream;

import java.io.IOException;

import java.util.List;

import java.util.StringTokenizer;

import java.util.zip.CRC32;

import java.util.zip.CheckedInputStream;

import org.apache.commons.io.FilenameUtils;

import org.dom4j.Document;

import org.dom4j.io.OutputFormat;

import org.dom4j.io.XMLWriter;

/**

*

*

* @Title: FileHelper.java

* @Package com.jarvis.base.util

* @Description:文件工具类

* @version V1.0

*/

public class FileHelper {

/**

* 1kb

*/

private final static int KB_1 = 1024;

/**

* 获得文件的CRC32校验和

*

* @param file

* 要进行校验的文件

* @return

* @throws Exception

*/

public static String getFileCRCCode(File file) throws Exception {

FileInputStream is = new FileInputStream(file);

CRC32 crc32 = new CRC32();

CheckedInputStream cis = new CheckedInputStream(is, crc32);

byte[] buffer = null;

buffer = new byte[KB_1];

while (cis.read(buffer) != -1) {

}

is.close();

buffer = null;

return Long.toHexString(crc32.getValue());

}

/**

* 获得字串的CRC32校验和

*

* @param string

* 要进行校验的字串

* @return

* @throws Exception

*/

public static String getStringCRCCode(String string) throws Exception {

ByteArrayInputStream inputStream = new ByteArrayInputStream(string.getBytes());

CRC32 crc32 = new CRC32();

CheckedInputStream checkedinputstream = new CheckedInputStream(inputStream, crc32);

byte[] buffer = null;

buffer = new byte[KB_1];

while (checkedinputstream.read(buffer) != -1) {

}

inputStream.close();

buffer = null;

return Long.toHexString(crc32.getValue());

}

/**

* 连接路径和文件名称,组成最后的包含路径的文件名

*

* @param basePath

* 文件路径

* @param fullFilenameToAdd

* 文件名称

* @return

*/

public static String concat(String basePath, String fullFilenameToAdd) {

return FilenameUtils.concat(basePath, fullFilenameToAdd);

}

/**

* 获得不带文件扩展名的文件名称

*

* @param filename

* 文件完整路径

* @return 不带扩展名的文件名称

*/

public static String getBaseName(String filename) {

return FilenameUtils.getBaseName(filename);

}

/**

* 获得带扩展名的文件名称

*

* @param filename

* 文件完整路径

* @return 文件名称

*/

public static String getFileName(String filename) {

return FilenameUtils.getName(filename);

}

/**

* 获得文件的完整路径,包含最后的路径分隔条

*

* @param filename

* 文件完整路径

* @return 目录结构

*/

public static String getFullPath(String filename) {

return FilenameUtils.getFullPath(filename);

}

/**

* 获得文件的完整路径,不包含最后的路径分隔条

*

* @param filename

* 文件完整路径

* @return

*/

public static String getFullPathNoEndSeparator(String filename) {

return FilenameUtils.getFullPathNoEndSeparator(filename);

}

/**

* 判断文件是否有某扩展名

*

* @param filename

* 文件完整路径

* @param extension

* 扩展名名称

* @return 若是,返回true,否则返回false

*/

public static boolean isExtension(String filename, String extension) {

return FilenameUtils.isExtension(filename, extension);

}

/**

* 判断文件的扩展名是否是扩展名数组中的一个

*

* @param filename

* 文件完整路径

* @param extensions

* 扩展名名称

* @return 若是,返回true,否则返回false

*/

public static boolean isExtension(String filename, String[] extensions) {

return FilenameUtils.isExtension(filename, extensions);

}

/**

* 规范化路径,合并其中的多个分隔符为一个,并转化为本地系统路径格式

*

* @param filename

* 文件完整路径

* @return

*/

public static String normalize(String filename) {

return FilenameUtils.normalize(filename);

}

/**

* 规范化路径,合并其中的多个分隔符为一个,并转化为本地系统路径格式,若是路径,则不带最后的路径分隔符

*

* @param filename

* 文件完整路径

* @return

*/

public static String normalizeNoEndSeparator(String filename) {

return FilenameUtils.normalizeNoEndSeparator(filename);

}

/**

* 把文件路径中的分隔符转换为unix的格式,也就是"/"

*

* @param path

* 文件完整路径

* @return 转换后的路径

*/

public static String separatorsToUnix(String path) {

return FilenameUtils.separatorsToUnix(path);

}

/**

* 把文件路径中的分隔符转换为window的格式,也就是"\"

*

* @param path

* 文件完整路径

* @return 转换后的路径

*/

public static String separatorsToWindows(String path) {

return FilenameUtils.separatorsToWindows(path);

}

/**

* 把文件路径中的分隔符转换当前系统的分隔符

*

* @param path

* 文件完整路径

* @return 转换后的路径

*/

public static String separatorsToSystem(String path) {

return FilenameUtils.separatorsToSystem(path);

}

/**

* 提取文件的扩展名

*

* @param filename

* 文件名称

* @return 文件扩展名,若没有扩展名,则返回空字符串

*/

public static String getExtension(String filename) {

return FilenameUtils.getExtension(filename);

}

/**

* 移出文件的扩展名

*

* @param filename

* 文件名称

* @return 若文件存在扩展名,则移出扩展名,然后返回移出后的值

*/

public static String removeExtension(String filename) {

return FilenameUtils.removeExtension(filename);

}

/**

* 清除一个目录的内容,但不删除此目录

*

* @param directory

* 需要清除的目录

* @return true:清除成功 false:清除失败

*/

public static boolean cleanDirectory(File directory) {

try {

org.apache.commons.io.FileUtils.cleanDirectory(directory);

return true;

} catch (IOException ex) {

ex.printStackTrace();

System.err.println("清除目录出错");

}

return false;

}

/**

* 拷贝一个目录的内容到另外一个目录中

*

* @param srcDir

* 源目录

* @param destDir

* 目的目录

* @return true:拷贝成功 false:拷贝失败

*/

public static boolean copyDirectory(File srcDir, File destDir) {

return copyDirectory(srcDir, destDir, true);

}

/**

* 拷贝一个目录的内容到另外一个目录中

*

* @param srcDir

* 源目录

* @param destDir

* 目的目录

* @return true:拷贝成功 false:拷贝失败

*/

public static boolean copyDirectory(String srcDir, String destDir) {

return copyDirectory(new File(srcDir), new File(destDir));

}

/**

* 拷贝一个目录的内容到另外一个目录中

*

* @param srcDir

* 源目录

* @param destDir

* 目的目录

* @param preserveFileDate

* 是否保持文件日期

* @return true:拷贝成功 false:拷贝失败

*/

public static boolean copyDirectory(File srcDir, File destDir, boolean preserveFileDate) {

try {

org.apache.commons.io.FileUtils.copyDirectory(srcDir, destDir, preserveFileDate);

return true;

} catch (IOException ex) {

ex.printStackTrace();

System.err.println("复制目录出错");

}

return false;

}

/**

* 拷贝源目录的内容到目的目录中(注:是拷贝到目的目录的里面)

*

* @param srcDir

* 源目录

* @param destDir

* 目的目录

* @return true:拷贝成功 false:拷贝失败

*/

public static boolean copyDirectoryToDirectory(File srcDir, File destDir) {

try {

org.apache.commons.io.FileUtils.copyDirectoryToDirectory(srcDir, destDir);

return true;

} catch (IOException ex) {

ex.printStackTrace();

System.err.println("复制目录出错");

}

return false;

}

/**

* 拷贝源目录的内容到目的目录中(注:是拷贝到目的目录的里面)

*

* @param srcDir

* 源目录

* @param destDir

* 目的目录

* @return true:拷贝成功 false:拷贝失败

*/

public static boolean copyDirectoryToDirectory(String srcDir, String destDir) {

return copyDirectoryToDirectory(new File(srcDir), new File(destDir));

}

/**

* 拷贝文件

*

* @param srcFile

* 源文件

* @param destFile

* 目的文件

* @return true:拷贝成功 false:拷贝失败

*/

public static boolean copyFile(File srcFile, File destFile) {

return copyFile(srcFile, destFile, true);

}

/**

* 拷贝文件

*

* @param srcFile

* 源文件路径

* @param destFile

* 目的文件路径

* @return true:拷贝成功 false:拷贝失败

*/

public static boolean copyFile(String srcFile, String destFile) {

return copyFile(new File(srcFile), new File(destFile));

}

/**

* 拷贝文件

*

* @param srcFile

* 源文件

* @param destFile

* 目的文件

* @param preserveFileDate

* 是否保留文件日期

* @return true:拷贝成功 false:拷贝失败

*/

public static boolean copyFile(File srcFile, File destFile, boolean preserveFileDate) {

try {

org.apache.commons.io.FileUtils.copyFile(srcFile, destFile, preserveFileDate);

return true;

} catch (IOException ex) {

ex.printStackTrace();

System.err.println("复制文件出错");

}

return false;

}

/**

* 拷贝文件到某目录中

*

* @param srcFile

* 源文件

* @param destDir

* 目的目录

* @return true:拷贝成功 false:拷贝失败

*/

public static boolean copyFileToDirectory(File srcFile, File destDir) {

try {

org.apache.commons.io.FileUtils.copyFileToDirectory(srcFile, destDir);

return true;

} catch (IOException ex) {

ex.printStackTrace();

System.err.println("复制文件出错");

}

return false;

}

/**

* 拷贝文件到某目录中

*

* @param srcFile

* 源文件

* @param destDir

* 目的目录

* @return true:拷贝成功 false:拷贝失败

*/

public static boolean copyFileToDirectory(String srcFile, String destDir) {

return copyFileToDirectory(new File(srcFile), new File(destDir));

}

/**

* 删除一个目录和该目录下的所有内容

*

* @param directory

* 需要删除的目录

* @return true:删除成功 false:删除失败

*/

public static boolean deleteDirectory(String directory) {

try {

org.apache.commons.io.FileUtils.deleteDirectory(new File(directory));

return true;

} catch (IOException ex) {

ex.printStackTrace();

System.err.println("删除目录出错");

}

return false;

}

/**

* 删除文件

*

* @param file

* 需要删除的文件路径

* @return true:删除成功 false:删除失败

*/

public static boolean deleteFile(String file) {

try {

org.apache.commons.io.FileUtils.forceDelete(new File(file));

return true;

} catch (IOException ex) {

ex.printStackTrace();

System.err.println("删除文件出错");

}

return false;

}

/**

* 递归创建目录

*

* @param directory

* 目录

* @return

*/

public static boolean createDirectory(String directory) {

try {

org.apache.commons.io.FileUtils.forceMkdir(new File(directory));

return true;

} catch (IOException ex) {

ex.printStackTrace();

System.err.println("创建目录出错");

}

return false;

}

/**

* 读入文件到字节数组中

*

* @param file

* 需要读取的文件路径

* @return 读取的字节数组,若读入失败,则返回null

*/

public static byte[] readFileToByteArray(String file) {

try {

byte[] bytes = org.apache.commons.io.FileUtils.readFileToByteArray(new File(file));

return bytes;

} catch (IOException ex) {

ex.printStackTrace();

System.err.println("读取文件出错");

}

return null;

}

/**

* 读入文件到字串中

*

* @param file

* 需要读取的文件路径

* @return 读取的文件内容,若读入失败,则返回空字串

*/

public static String readFileToString(String file, String encoding) {

try {

if (StringHelper.isEmpty(encoding)) {

encoding = "GBK";

}

String content = org.apache.commons.io.FileUtils.readFileToString(new File(file), encoding);

return content;

} catch (IOException ex) {

ex.printStackTrace();

System.err.println("读取文件出错");

}

return "";

}

/**

* 读入文件到字串中

*

* @param file

* 需要读取的文件路径

* @return 读取的文件内容,若读入失败,则返回空字串

*/

public static String readFileToString(String file) {

return readFileToString(file, "GBK");

}

/**

* 读入文本文件到一个按行分开的List中

*

* @param file

* 需要读取的文件路径

* @return 按行内容分开的List

*/

@SuppressWarnings("rawtypes")

public static List readLines(String file) {

return readLines(file, "GBK");

}

/**

* 读入文本文件到一个按行分开的List中

*

* @param file

* 需要读取的文件路径

* @return 按行内容分开的List

*/

@SuppressWarnings("rawtypes")

public static List readLines(String file, String encoding) {

try {

if (StringHelper.isEmpty(encoding)) {

encoding = "GBK";

}

List lineList = org.apache.commons.io.FileUtils.readLines(new File(file), encoding);

return lineList;

} catch (IOException ex) {

ex.printStackTrace();

System.err.println("读取文件出错");

}

return null;

}

/**

* 递归求一个目录的容量大小

*

* @param directory

* 需要计算容量的目录路径

* @return 容量的大小(字节数)

*/

public static long sizeOfDirectory(String directory) {

return org.apache.commons.io.FileUtils.sizeOfDirectory(new File(directory));

}

/**

* 写字节数组到文件中,若文件不存在,则建立新文件

*

* @param file

* 需要写的文件的路径

* @param data

* 需要写入的字节数据

* @return true:写入成功 false:写入失败

*/

public static boolean writeToFile(String file, byte[] data) {

try {

org.apache.commons.io.FileUtils.writeByteArrayToFile(new File(file), data);

return true;

} catch (IOException ex) {

ex.printStackTrace();

System.err.println("写文件出错");

}

return false;

}

/**

* 写字串到文件中,若文件不存在,则建立新文件

*

* @param file

* 需要写的文件的路径

* @param data

* 需要写入的字串

* @return true:写入成功 false:写入失败

*/

public static boolean writeToFile(String file, String data) {

return writeToFile(file, data, "GBK");

}

/**

* 写字串到文件中,若文件不存在,则建立新文件

*

* @param file

* 需要写的文件的路径

* @param data

* 需要写入的字串

* @param dncoding

* 文件编码,默认为GBK

* @return true:写入成功 false:写入失败

*/

public static boolean writeToFile(String file, String data, String encoding) {

try {

if (encoding == null || "".equals(encoding)) {

encoding = "GBK";

}

org.apache.commons.io.FileUtils.writeStringToFile(new File(file), data, encoding);

return true;

} catch (IOException ex) {

ex.printStackTrace();

System.err.println("写文件出错");

}

return false;

}

/**

* 建立由filePathName指定的文件,若文件路径中的目录不存在,则先建立目录

*

* @param filePathName

* 文件路径全名

* @return

*/

public static boolean createNewFile(String filePathName) {

String filePath = FileHelper.getFullPath(filePathName);

// 若目录不存在,则建立目录

if (!FileHelper.exists(filePath)) {

if (!createDirectory(filePath)) {

return false;

}

}

try {

File file = new File(filePathName);

return file.createNewFile();

} catch (IOException ex) {

ex.printStackTrace();

System.err.println("创建文件出错");

return false;

}

}

/**

* 判断文件和目录是否已存在

*

* @param filePath

* 文件和目录完整路径

* @return tru:存在 false:不存在

*/

public static boolean exists(String filePath) {

File file = new File(filePath);

return file.exists();

}

/**

* 判断特定的路径是否为文件

*

* @param filePath

* 文件完整的路径

* @return 若是文件,则返回true,否则返回false

*/

public static boolean isFile(String filePath) {

File file = new File(filePath);

return file.isFile();

}

/**

* 判断特定的路径是否为目录

*

* @param filePath

* 文件完整的路径

* @return 若是目录,则返回true,否则返回false

*/

public static boolean isDirectory(String filePath) {

File file = new File(filePath);

return file.isDirectory();

}

/**

* 更改文件的名称,若不在同一个目录下,则系统会移动文件

*

* @param srcFile

* 源文件路径名称

* @param destFile

* 目的文件路径名称

* @return

*/

public static boolean renameTo(String srcFile, String destFile) {

File file = new File(srcFile);

return file.renameTo(new File(destFile));

}

/**

*

* 描述:根据document生成Xml文件 作者:刘宝 时间:Jun 9, 2010 3:16:11 PM

*

* @param fileName

* 生成文件的路径

* @param document

* @param encoding

* 编码格式

* @return

*/

public static boolean WriteToXMLFile(String fileName, Document document, String encoding) {

createNewFile(fileName);

boolean success = false;

/** 格式化输出,类型IE浏览一样 */

OutputFormat format = OutputFormat.createPrettyPrint();

/** 指定XML编码 */

format.setEncoding(encoding);

XMLWriter writer = null;

try {

/** 将document中的内容写入文件中 */

writer = new XMLWriter(new FileOutputStream(new File(fileName)), format);

writer.write(document);

writer.flush();

success = true;

/** 执行成功,需返回true */

} catch (Exception ex) {

ex.printStackTrace();

System.err.println("写文件出错");

} finally {

if (writer != null) {

try {

writer.close();

writer = null;

} catch (IOException e) {

e.printStackTrace();

System.err.println("Convert code Error");

}

}

}

return success;

}

/**

* 获取文件的后缀名并转化成大写

*

* @param fileName

* 文件名

* @return

*/

public String getFileSuffix(String fileName) throws Exception {

return fileName.substring(fileName.lastIndexOf(".") + 1,

fileName.length()).toUpperCase();

}

/**

* 创建多级目录

*

* @param path

* 目录的绝对路径

*/

public void createMultilevelDir(String path) {

try {

StringTokenizer st = new StringTokenizer(path, "/");

String path1 = st.nextToken() + "/";

String path2 = path1;

while (st.hasMoreTokens()) {

path1 = st.nextToken() + "/";

path2 += path1;

File inbox = new File(path2);

if (!inbox.exists())

inbox.mkdir();

}

} catch (Exception e) {

System.out.println("目录创建失败" + e);

e.printStackTrace();

}

}

/**

* 删除文件/目录(递归删除文件/目录)

*

* @param path

* 文件或文件夹的绝对路径

*/

public void deleteAll(String dirpath) {

if (dirpath == null) {

System.out.println("目录为空");

} else {

File path = new File(dirpath);

try {

if (!path.exists())

return;// 目录不存在退出

if (path.isFile()) // 如果是文件删除

{

path.delete();

return;

}

File[] files = path.listFiles();// 如果目录中有文件递归删除文件

for (int i = 0; i < files.length; i++) {

deleteAll(files[i].getAbsolutePath());

}

path.delete();

} catch (Exception e) {

System.out.println("文件/目录 删除失败" + e);

e.printStackTrace();

}

}

}

/**

* 文件/目录 重命名

*

* @param oldPath

* 原有路径(绝对路径)

* @param newPath

* 更新路径

* @author lyf 注:不能修改上层次的目录

*/

public void renameDir(String oldPath, String newPath) {

File oldFile = new File(oldPath);// 文件或目录

File newFile = new File(newPath);// 文件或目录

try {

boolean success = oldFile.renameTo(newFile);// 重命名

if (!success) {

System.out.println("重命名失败");

} else {

System.out.println("重命名成功");

}

} catch (RuntimeException e) {

e.printStackTrace();

}

}

/**

* 新建目录

*/

public static boolean newDir(String path) throws Exception {

File file = new File(path);

return file.mkdirs();//创建目录

}

/**

* 删除目录

*/

public static boolean deleteDir(String path) throws Exception {

File file = new File(path);

if (!file.exists())

return false;// 目录不存在退出

if (file.isFile()) // 如果是文件删除

{

file.delete();

return false;

}

File[] files = file.listFiles();// 如果目录中有文件递归删除文件

for (int i = 0; i < files.length; i++) {

deleteDir(files[i].getAbsolutePath());

}

file.delete();

return file.delete();//删除目录

}

/**

* 更新目录

*/

public static boolean updateDir(String path, String newPath) throws Exception {

File file = new File(path);

File newFile = new File(newPath);

return file.renameTo(newFile);

}

// 删除文件夹

// param folderPath 文件夹完整绝对路径

public static void delFolder(String folderPath) {

try {

delAllFile(folderPath); // 删除完里面所有内容

String filePath = folderPath;

filePath = filePath.toString();

java.io.File myFilePath = new java.io.File(filePath);

myFilePath.delete(); // 删除空文件夹

} catch (Exception e) {

e.printStackTrace();

}

}

// 删除指定文件夹下所有文件

// param path 文件夹完整绝对路径

public static boolean delAllFile(String path) {

boolean flag = false;

File file = new File(path);

if (!file.exists()) {

return flag;

}

if (!file.isDirectory()) {

return flag;

}

String[] tempList = file.list();

File temp = null;

for (int i = 0; i < tempList.length; i++) {

if (path.endsWith(File.separator)) {

temp = new File(path + tempList[i]);

} else {

temp = new File(path + File.separator + tempList[i]);

}

if (temp.isFile()) {

temp.delete();

}

if (temp.isDirectory()) {

delAllFile(path + "/" + tempList[i]);// 先删除文件夹里面的文件

delFolder(path + "/" + tempList[i]);// 再删除空文件夹

flag = true;

}

}

return flag;

}

public static void main(String d[]) throws Exception{

//deleteDir("d:/ff/dddf");

updateDir("D:\\TOOLS\\Tomcat 6.0\\webapps\\BCCCSM\\nationalExperiment/22222", "D:\\TOOLS\\Tomcat 6.0\\webapps\\BCCCSM\\nationalExperiment/224222");

}

}

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

java file ip_java常用工具类 IP、File文件工具类相关推荐

  1. 看懂oracle trc文件,oracle 的 debug 工具 和 分析 trc 文件工具 ass.awk

    oracle的dump工具和分析trc文件工具ass.awk 之前介绍了oracle的一个hang住时的一个分析工具hanganalyze,这里再引入另外的一个工具,分析系统进程和单个进程的工具 1. ...

  2. 计算机 ip 地址分为那几类,ip地址分为几类

    ip地址可以分为两类:静态IP地址和动态IP地址.下面我们就来看一下静态IP地址和动态IP地址的具体内容. 静态IP地址 静态IP地址通常不会更改,但可能会因网络管理而更改.它们作为永久的Intern ...

  3. 私有IP,A类IP地址,B类IP地址,C类IP地址

    1.私有IP 是本地局域网的IP. 2.A类IP地址 一个A类IP地址是指,在IP地址的四段号码中,第一段号码为网络号码,剩下的三段号码为本地计算机的号码.如果用二进制表示IP地址的话,A类IP地址就 ...

  4. java socket ip_JAVA 网络编程 TCP/IP、Socket 和协议设计

    [JAVA 网络编程 TCP/IP.Socket 和协议设计] TCP/IP 协议简介 IP 首先我们看 IP(Internet Protocol)协议.IP 协议提供了主机和主机间的通信. 为了完成 ...

  5. A、B、C、D、E类IP地址都是怎么划分的?

    IP地址的格式:IP地址=网络地址+主机地址 如果IP进行了子网划分: 则IP地址=网络地址+子网地址+主机地址 网络地址是互联网上的节点在网络中具有的逻辑地址.MAC地址,处于数据链路层,IP地址处 ...

  6. 在线IP地址查询工具

    在线IP地址查询工具 在线IP地址查询工具 查询指定IPV4地址的归属地,暂不支持IPV6地址,数据来源为纯真IP数据库,仅供参考 https://tooltt.com/ip/

  7. IP地址为A类B类C类D类E类

    简单的说根据IP地址的范围可以判断:A.类网络的IP地址范围为:1.0.0.1-126.255.255.254: B.类网络的IP地址范围为:128.1.0.1-191.255.255.254: C. ...

  8. 【A、B、C、D、E类IP地址划分依据,你都会吗?】

    IP 地址的格式:IP 地址 = 网络地址 + 主机地址 如果 IP 进行了子网划分: 则IP地址=网络地址+子网地址+主机地址 网络地址是互联网上的节点在网络中具有的逻辑地址.MAC 地址,处于数据 ...

  9. a类 b类 c类 ip地址范围

    现在的IP网络使用32位地址,以点分十进制表示,如172.16.0.0.地址格式为:IP地址=网络地址+主机地址 或 IP地址=主机地址+子网地址+主机地址.  IP地址类型 最初设计互联网络时,为了 ...

最新文章

  1. 利用angular结合translate为项目实现国际化
  2. sql server set赋值和select 赋值的区别以及使用方法
  3. Unknown column 'XXX' in 'where clause'一例排查
  4. java开发亚马逊mws_GitHub - iotwlw/Amazon-MWS-SDK: 基于亚马逊MWS Java SDK 的封装
  5. 交换知识 VLAN VTP STP 单臂路由
  6. java读properties的通用类,兼容linux和windows
  7. 线程基础阶段性总结和扩展(一)
  8. echarts地图map下钻到镇街、KMZ文件转GeoJson、合成自定义区域
  9. 爬取当当网评论(1)
  10. VFP全面控制EXCEL(转自十豆三老师)
  11. 关于HDS的高端存储设备USPV
  12. 金庸武侠内功排行榜TOP10
  13. 安卓桌面软件哪个好_每日提醒软件哪个好?电脑上有什么好用的可以每天提醒的桌面便签软件...
  14. 腾讯课堂老师可以看到学生本人吗?
  15. ERD Commander 2005 Boot CD 剖析及汉化试验
  16. 人工智能融入售后服务 实现精准售后备件需求预测
  17. 键盘输入盲打训练, 打字练习,打字游戏 打字教程推荐
  18. linux虚拟机mtr不出去,如何使用MTR诊断网络问题
  19. 找回那些年,你手机号注册过的网站
  20. 【经验分享】美赛报名以及注册方法-以2023年美赛为例

热门文章

  1. 看完这个你还不理解右值引用和移动构造 你就可以来咬我(下)
  2. Android开发之java8 lambad表达式的使用
  3. python web 框架的flash消息_python web开发-flask中消息闪现flash的应用
  4. 计算机模拟 博弈 善意,从两本奇书看人与人的重复博弈
  5. php java 架构_JAVA和PHP到底谁才是老大?
  6. Linux安装net的工具,centos7安装netbox(不错开源网络管理工具) – 运维那些事
  7. 【汇编】汇编学习入门-系列更新20180705
  8. dubbo(provider,consumer)点到点直连配置
  9. 查看Linux服务器的CPU详细信息
  10. ubuntu14.04中 gedit 凝视能显示中文,而source insight中显示为乱码的解决的方法