标签:bre 网站 void 后台 lan round ida href blank
今天访问了某一网站,看到了这一功能.可以判断出当前浏览者的操作系统,并且是32的还是64的.感觉这一功能挺不错,于是便研究了一下.分享给大家.
如果你做的是系统型应用系统(后台系统),此代码可以无视,可以用不到。但是如果你做的是互联网型(网站,带站点的)这可能会用到.
public static void main(String[] args) { //String s = RandomNum.getRandomNumStr(5); //System.out.println(s); System.out.println("生成5个含有5个字符的字符串:"); RandomNum.SuiJiZiFuChuan(5,5); System.out.println("生成3个含有6个字符的字符串:"); RandomNum.SuiJiZiFuChuan(6,3); System.out.println("生成任意1到20个含有任意1到10个字符的字符串:"); RandomNum.SuiJiZiFuChuan((int)(20*Math.random()),(int)(10*Math.random())); System.out.println("随机性生成字符:"); int i=0; while(i<(int)(10*Math.random())){ RandomNum.SuiJiZiFuChuan((int)(20*Math.random()),1); i++; } } public static void SuiJiZiFuChuan(int x,int y){ for(int j=0;j<y;j++){ for(int i=0;i<x;i++){ int a=(int)(100*Math.random()+100*Math.random()); while(true){ if(a>96&a<123) break; else a=(int)(100*Math.random()+100*Math.random()); } System.out.print((char)a); } System.out.println(); } }
这是java做的.
下载下来,可以直接加入到项目中运行.无需要任何jar包
使用java和javascript判断当前浏览者的操作系统 - 日记
标签:bre 网站 void 后台 lan round ida href blank
原文地址:https://www.cnblogs.com/zhaoyanchun44/p/12735240.html