「java读卡」sim卡

博主:adminadmin 2023-01-18 02:54:05 452

本篇文章给大家谈谈java读卡,以及sim卡对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

java写读取sd卡内容 谁能告诉个大概思路

你怎么去读取呢?

sd卡通过读卡器插入电脑

java自然是没办法直接操作sd卡的,因为你没读卡器的驱动。没办法直接操作。

但windows一般将读卡器识别为一个磁盘。

所以java 可以按读取本地磁盘一样通过读卡器读取sd卡

Java实现读取本机网卡Mac地址

本方法主要用来限制系统在其他的机器上运行 其实原理简单的很 没有调用第三方插件 代码如下:

package users util;

import    java io *;

import    java util *;

import    java util regex *;

public    class    NetID    {

String    IPCONFIG_MAND_WIN    =    ipconfig    /all ;

boolean    realMac    =    true;

String    unique    =    ;

public    static    String    getMacAddress()    {

NetID    hwid    =    new    NetID();

return    hwid getUnique() trim();

}

private    String    getUnique()    {

String    os    =    System getProperty( os name );

if    (os startsWith( Windows ))    {

return    getUniqueWindows();

}else    {

return    ;

}

}

private    String    getUniqueWindows()    {

String    ipConfigResponse    =    null;

try    {

ipConfigResponse    =    runConsoleCommand(IPCONFIG_MAND_WIN);

}

catch    (IOException    e)    {

e printStackTrace();

}

StringTokenizer    tokenizer    =    new    StringTokenizer(ipConfigResponse     \n );

while    (tokenizer hasMoreTokens())    {

String    line    =    tokenizer nextToken() trim();

int    macAddressPosition    =    line indexOf( : );

if    (macAddressPosition    =    )    {

continue;

}

String    macAddressCandidate    =    line substring(macAddressPosition    +    )

trim();

if    (isMacAddWin(macAddressCandidate))    {

if    (realMac    ==    true)    {

generateUnique(macAddressCandidate);

}

else    {

realMac    =    true;

}

}

}

return    unique;

}

private    String    runConsoleCommand(String    mand)    throws    IOException    {

Process    p    =    Runtime getRuntime() exec(mand);

InputStream    stdoutStream    =    new    BufferedInputStream(p getInputStream());

StringBuffer    buffer    =    new    StringBuffer();

while    (true)    {

int    c    =    stdoutStream read();

if    (c    ==    )    {

break;

}

buffer append(    (char)    c);

}

String    outputText    =    buffer toString();

stdoutStream close();

return    outputText;

}

private    boolean    isMacAddWin(String    macAddressCandidate)    {

Pattern    macPattern    =    pile( [ a fA F]{ } [ a fA F]{ } [ a fA F]{ } [ a fA F]{ } [ a fA F]{ } [ a fA F]{ } );

Matcher    m    =    macPattern matcher(macAddressCandidate);

return    m matches();

}

private    boolean    isMacAddOSX(String    macAddressCandidate)    {

if    (macAddressCandidate length()    !=    )    {

return    false;

}

else    {

return    true;

}

}

private    void    generateUnique(String    macAddress)    {

if    (unique    ==    )    {

unique    +=    macAddress;

}

else    {

unique    +=    # ;

unique    +=    macAddress;

}

}

public    static    void    main(String [] args)    {

System out println(NetID getMacAddress());

}

lishixinzhi/Article/program/Java/hx/201311/25985

如何用java编写通过IC卡读卡器读取IC卡的程序

使用java读卡例程,附件是YW-607读卡器的SDK,里面有java读写卡的例程读卡器SDK

高分请教java如何与非接触式IC卡读卡器交互?

和硬件交互的产品不能靠yy解决,看人家有没有java的API,如果没有,就要手动封装别的语言的API成Java的API,如果有直接调用就行

关于java读卡和sim卡的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。