Android Demo手机获取验证码
注册很多app或者网络账户的时候,经常需要手机获取验证码,来完成注册,那时年少,只是觉得手机获取验证码这件事儿很好玩,并没有关心太多,她是如何实现的,以及她背后的故事到底是什么样子的,现在小编接手的这个项目里面,就需要通过手机号进行注册,并且手机号发送相应的验证码,来完成注册,那么在一些应用app里面到底是如何实现点击按钮获取验证码,来完成注册这整个流程的呢?今天小编就以注册为例,和小伙伴们分享一下,如何通过手机号获取验证码来完成注册的一整套流程以及如何采用正则表达式来验证手机号码是否符合电信、移动、联通的规范。
首先我们需要做的第一步就是ApiClient里面编写获取验证码的方法,具体代码如下:
/**
* 说明:获取验证码
* 作者:丁国华
* 时间:2015-8-27 下午5:47:36
*/
public static String getValidateCode(AppContext appContext,
Map<String, Object> map) throws AppException {
// 定义要访问的接口和要强转的实体
String validateUrl = _MakeURL(URLs.VALIDATE_CODE_URL, map);
ValidateCode validateCode = null;
try {
// 获取服务器端Json数据
String json = http_get(appContext, validateUrl);
// 解析为制定的实体对象
validateCode = (ValidateCode) JSON.parseObject(json,
ValidateCode.class);
} catch (Exception e) {
if (e instanceof AppException)
throw (AppException) e;
throw AppException.network(e);
}
// 返回验证码
return validateCode.getCode();
}
第二步编写AppContent里面的接口方法,具体代码如下所示:
/**
* 说明:获取服务器验证码(不需要缓存)
* 作者:丁国华
* @date 2015-8-28 上午9:07:14
*/
public String getCode(Map<String, Object> map) throws AppException {
String validateCode = "";
// 如果网络可连接且解析无误返回正确的验证码,否则返回空字符串
if (isNetworkConnected()) {
try {
validateCode = ApiClient.getValidateCode(this, map);
} catch (AppException e) {
if (validateCode == "") {
throw e;
}
}
}
return validateCode;
}
第三步,在StringUtils里面编写验证号码是否是手机号的正则表达式,具体代码如下:
/* 说明:移动:134、135、136、137、138、139、150、151、157(TD)、158、159、187、188
* 联通:130、131、132、152、155、156、185、186
* 电信:133、153、180、189
* 总结起来就是第一位必定为1,第二位必定为3或5或8,其他位置的可以为0-9
* 验证号码 手机号 固话均可
* 作者:丁国华
* 2015年9月20日 13:52:35
*/
public static boolean isPhoneNumberValid(String phoneNumber) {
boolean isValid = false;
String expression = "((^(13|15|18)[0-9]{9}$)|(^0[1,2]{1}\\d{1}-?\\d{8}$)|(^0[3-9] {1}\\d{2}-?\\d{7,8}$)|(^0[1,2]{1}\\d{1}-?\\d{8}-(\\d{1,4})$)|(^0[3-9]{1}\\d{2}-? \\d{7,8}-(\\d{1,4})$))";
CharSequence inputStr = phoneNumber;
Pattern pattern = Pattern.compile(expression);
Matcher matcher = pattern.matcher(inputStr);
if (matcher.matches() ) {
isValid = true;
}
return isValid;
}
第四步:编写xml里面的文件,具体代码如下所示:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout style="@style/top_title_style" >
<Button
android:id="@+id/register_back_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@null"
android:drawableLeft="@drawable/back"
android:paddingLeft="5dp"
android:text=" 登录"
android:textColor="#FFFFFF"
android:textSize="18sp" />
<!-- 注册的布局 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_marginTop="2dp"
android:layout_weight="1"
android:gravity="center"
android:paddingLeft="4dp"
android:text="注册"
android:textColor="#FFFFFF"
android:textSize="20sp" />
<!-- 注册的布局 -->
<TextView
android:id="@+id/nickname_confirm"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="2dp"
android:gravity="center"
android:paddingLeft="60dp"
android:paddingRight="10dp"
android:textColor="#FFFFFF"
android:textSize="20sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="45dp"
android:minHeight="50.0dip"
android:paddingLeft="14.0dip"
android:paddingRight="12.0dip" >
<ImageView
android:layout_width="23.0dip"
android:layout_height="23.0dip"
android:layout_centerVertical="true"
android:src="@drawable/user_picture" />
<EditText
android:id="@+id/et_register_username_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:background="@null"
android:hint="用户名/手机号"
android:paddingLeft="15dip"
android:paddingTop="8dp"
android:textColorHint="#BEBEBE"
android:textSize="20sp" />
</RelativeLayout>
<View style="@style/PersonalLine" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="45dp"
android:minHeight="50.0dip"
android:paddingLeft="14.0dip"
android:paddingRight="12.0dip" >
<ImageView
android:layout_width="23.0dip"
android:layout_height="23.0dip"
android:layout_centerVertical="true"
android:src="@drawable/phone_picture" />
<EditText
android:id="@+id/et_register_code_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:background="@null"
android:hint="请输入验证码"
android:paddingLeft="15dip"
android:paddingTop="8dp"
android:textColorHint="#BEBEBE"
android:textSize="20sp" />
<Button
android:id="@+id/bt_getcode_id"
android:layout_width="120dp"
android:layout_height="35dp"
android:layout_marginLeft="200dp"
android:layout_marginTop="5dp"
android:background="@drawable/shape1"
android:text="获取验证码"
android:textColor="#FFFFFF"
android:textSize="10sp" />
</RelativeLayout>
<View style="@style/PersonalLine" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="45dp"
android:minHeight="50.0dip"
android:paddingLeft="14.0dip"
android:paddingRight="12.0dip" >
<ImageView
android:layout_width="23.0dip"
android:layout_height="23.0dip"
android:layout_centerVertical="true"
android:src="@drawable/lock" />
<EditText
android:id="@+id/et_register_password_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:background="@null"
android:hint="请输入新密码"
android:paddingLeft="15dip"
android:paddingTop="8dp"
android:textColorHint="#BEBEBE"
android:textSize="20sp" />
</RelativeLayout>
<View style="@style/PersonalLine" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<!-- 小对勾的布局 -->
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginLeft="-10dp"
android:scaleX="0.8"
android:scaleY="0.8" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="我同意"
android:textSize="18sp" />
<TextView
android:id="@+id/user_protocol"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:gravity="center"
android:text="用户协议及隐私条款"
android:textColor="#FE8B4A"
android:textSize="18sp" />
</LinearLayout>
<Button
android:id="@+id/bt_register_id"
android:layout_width="245dp"
android:layout_height="45dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="14dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp"
android:background="@drawable/shape2"
android:gravity="center"
android:text="注 册"
android:textColor="#FFFFFF"
android:textSize="15sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="80dp"
android:paddingTop="5dp"
android:text="您也可以直接登录"
android:textColor="#BEBEBE"
android:textSize="20sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:baselineAligned="false"
android:gravity="center"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical" >
<Button
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@drawable/weixin_login" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="微信登录"
android:textColor="#BEBEBE"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical" >
<Button
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@drawable/weibo_login" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="微博登录"
android:textColor="#BEBEBE"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical" >
<Button
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@drawable/qq_login" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="QQ登录"
android:textColor="#BEBEBE"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
第五步:编写java类RegisterActivity里面的代码,具体如下所示:
package com.jczb.car.ui;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Map;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.jczb.car.AppContext;
import com.jczb.car.AppException;
import com.jczb.car.R;
import com.jczb.car.common.StringUtils;
/**
* 说明:注册功能页面 我们实现了取消线程的机制,从而保证它不会泄露 onDestroy()常常被用来在Activity推出前取消线程
* 作者: 吴利昌
* 时间: 2015-9-3上午9:19:15
*/
public class RegisterActivity extends Activity implements OnClickListener {
// 声明用到的页面控件
private EditText etRegisterName;
private EditText etCode;
private EditText etPassword;
private Button btCode;
private Button btRegister;
private TextView tvUserProtocol;
private Button btRegisterLoginBack;
// 定义变量
private String userName;
private String passWord;
public boolean isChange = false;
private boolean tag = true;
private int i = 60;
Thread thread = null;
/**客户端输入的验证码*/
private String valicationCode;
/**服务器端获取的验证码*/
private static String serverValicationCode;
/** 注册时所带的参数 */
private Map<String, Object> registerParams = new HashMap<String, Object>();
/** 获取验证码时所带的参数 */
private Map<String, Object> codeParams = new HashMap<String, Object>();
/** 注册是否成功 */
private String regisgerStatus;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.register);
initView();
}
/**
* 说明:初始化页面控件和事件
* 作者: 吴利昌
* 时间: 2015-9-3 上午9:23:42
*/
public void initView() {
// 初始化控件
etRegisterName = (EditText) findViewById(R.id.et_register_username_id);
etCode = (EditText) findViewById(R.id.et_register_code_id);
etPassword = (EditText) findViewById(R.id.et_register_password_id);
btCode = (Button) findViewById(R.id.bt_getcode_id);
btRegister = (Button) findViewById(R.id.bt_register_id);
tvUserProtocol=(TextView)findViewById(R.id.user_protocol);
btRegisterLoginBack=(Button)findViewById(R.id.register_back_login);
// 初始化监听事件
btCode.setOnClickListener(this);
btRegister.setOnClickListener(this);
tvUserProtocol.setOnClickListener(this);
btRegisterLoginBack.setOnClickListener(this);
}
private boolean isvalidate() {
// TODO Auto-generated method stub
// 获取控件输入的值
String userName = etRegisterName.getText().toString().trim();
if (StringUtils.isEmpty(userName)) {
Toast.makeText(this, "手机号不能为空", Toast.LENGTH_SHORT).show();
return false;
}
if (!StringUtils.isPhoneNumberValid(userName)) {
Toast.makeText(this, "手机号有误", Toast.LENGTH_SHORT).show();
return false;
}
return true;
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.bt_getcode_id:
if(!isvalidate())
break;
btCode.setText("获取验证码");
btCode.setClickable(true);
isChange = true;
changeBtnGetCode();
getValidateCode();
break;
case R.id.bt_register_id:
register();
break;
case R.id.user_protocol:
Intent intentUserProtocol = new Intent(this,UserProtocolActivity.class);
startActivity(intentUserProtocol);
break;
case R.id.register_back_login:
this.finish();
break;
default:
break;
}
}
private void changeBtnGetCode() {
thread = new Thread() {
@Override
public void run() {
if (tag) {
while (i > 0) {
i--;
if (RegisterActivity.this == null) {
break;
}
RegisterActivity.this
.runOnUiThread(new Runnable() {
@Override
public void run() {
btCode.setText("获取验证码("
+ i + ")");
btCode
.setClickable(false);
}
});
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
tag = false;
}
i = 60;
tag = true;
if (RegisterActivity.this != null) {
RegisterActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
btCode.setText("获取验证码");
btCode.setClickable(true);
}
});
}
};
};
thread.start();
}
/**
* 说明:获取验证码
*
* 作者: 吴利昌
* 时间: 2015-9-3 下午3:26:55
*/
public boolean getValidateCode() {
String name = etRegisterName.getText().toString().trim();
String code = etCode.getText().toString().trim();
if (name.equals("")) {
Toast.makeText(this, "请输入用户名或手机号!", Toast.LENGTH_SHORT).show();
return false;
}else {
userName = name;
valicationCode = code;
Thread codeThread = new Thread(codeRunnable);
codeThread.start();
}
return true;
}
/**
* 说明:注册
*
* 作者: 吴利昌
* 时间: 2015-9-3 下午3:27:23
*/
public void register() {
// 1.首先判断输入的值是否有效
// 2.然后判断输入的验证码是否有效(防止没有点击获取验证码自己填的错误验证码)
// 3.最后注册
if (isValid()) {
if (valicationCode.equals(serverValicationCode)) {
Thread thread = new Thread(sRunnable);
thread.start();
}else {
Toast.makeText(this, "输入的验证码不正确!", Toast.LENGTH_SHORT).show();
}
}
}
//--------------------------------获取验证码线程处理过程---开始-----------------------------
/**
* 自定义一个静态的具有弱引用的Handler,解决内存泄漏的问题,本handler用来获取验证码
*/
private static class CodeHandler extends Handler {
// 持有对本外部类的弱引用
private final WeakReference<RegisterActivity> mActivity;
public CodeHandler(RegisterActivity activity) {
mActivity = new WeakReference<RegisterActivity>(activity);
}
@Override
public void handleMessage(Message msg) {
// 获取上下文对象
RegisterActivity activity = mActivity.get();
if (activity != null) {
switch (msg.what) {
case 1:
serverValicationCode = (String)msg.obj;
//activity.etCode.setText(serverValicationCode);
break;
case -1:
Toast.makeText(activity, "获取验证码失败!", Toast.LENGTH_SHORT).show();
break;
case 0:
Toast.makeText(activity, "哎呀,出错啦..", Toast.LENGTH_SHORT).show();
break;
default:
break;
}
}
}
}
/**实例化自定义的handler*/
private final CodeHandler codeHandler = new CodeHandler(this);
private String serverCode=null;
/**定义获取验证码的子线程*/
private Runnable codeRunnable = new Runnable() {
@Override
public void run() {
Message msg = new Message();
Map<String, Object> map = new HashMap<String, Object>();
map.put("jbPhone", userName);
// 获取全局对象Application
AppContext appContext = (AppContext) getApplication();
try {
// 获取服务器数据
serverValicationCode = appContext.getCode(map);
// 返回true则将消息的what值为1,为false则what为-1,异常为0
if (serverValicationCode.equals("")) {
msg.what = -1;
} else {
msg.what = 1;
msg.obj = serverValicationCode;
}
} catch (AppException e) {
msg.what = 0;
e.printStackTrace();
}
codeHandler.sendMessage(msg);
}
};
//--------------------------------获取验证码线程处理过程----完成------------------------------
//--------------------------------注册线程处理过程--开始----------------------------------
/**
* 自定义一个静态的具有弱引用的Handler,解决内存泄漏的问题,注册使用
*/
private static class MyHandler extends Handler {
// 持有对本外部类的弱引用
private final WeakReference<RegisterActivity> mActivity;
public MyHandler(RegisterActivity activity) {
mActivity = new WeakReference<RegisterActivity>(activity);
}
@Override
public void handleMessage(Message msg) {
// 获取上下文对象
RegisterActivity activity = mActivity.get();
if (activity != null) {
switch (msg.what) {
case 1:
Toast.makeText(activity, "注册成功!", Toast.LENGTH_SHORT).show();
activity.finish();
break;
case -1:
Toast.makeText(activity, "注册失败!", Toast.LENGTH_SHORT).show();
break;
case -2:
Toast.makeText(activity, "该号已经注册!", Toast.LENGTH_SHORT).show();
break;
case 0:
Toast.makeText(activity, "哎呀,出错啦..", Toast.LENGTH_SHORT).show();
break;
default:
break;
}
}
}
}
/**实例化自定义的handler*/
private final MyHandler mHandler = new MyHandler(this);
/**自定义子线程*/
private Runnable sRunnable = new Runnable() {
@Override
public void run() {
Message msg = new Message();
// 获取全局对象Application
AppContext appContext = (AppContext) getApplication();
try {
// 获取服务器数据
regisgerStatus = appContext.register(registerParams);
// 返回true则将消息的what值为1,为false则what为-1,异常为0
if (regisgerStatus.equals("true")) {
msg.what = 1;
msg.obj = regisgerStatus;
} else if(regisgerStatus.equals("1")){
msg.what = -2;
}else if(regisgerStatus.equals("false")){
msg.what = -1;}
} catch (AppException e) {
msg.what = 0;
e.printStackTrace();
}
mHandler.sendMessage(msg);
}
};
//--------------------------------注册线程处理过程---完成-----------------------------------
/**
* 说明:注册之前判断数据是否为空
*
* @return
* 作者: 吴利昌
* 时间: 2015-9-3 下午3:29:04
*/
public boolean isValid() {
userName = etRegisterName.getText().toString().trim();
valicationCode = etCode.getText().toString().trim();
passWord = etPassword.getText().toString().trim();
if (userName.equals("")) {
Toast.makeText(this, "用户名不能为空!", Toast.LENGTH_SHORT).show();
return false;
}
if (valicationCode.equals("")) {
Toast.makeText(this, "验证码不能为空!", Toast.LENGTH_SHORT).show();
return false;
}
if(!serverValicationCode.equals(valicationCode))
{
Toast.makeText(this, "验证码错误", Toast.LENGTH_SHORT).show();
return false;
}
if (passWord.equals("")) {
Toast.makeText(this, "密码不能为空!", Toast.LENGTH_SHORT).show();
return false;
} else if (passWord.length() < 6) {
Toast.makeText(this, "密码至少6位!", Toast.LENGTH_SHORT).show();
return false;
}
registerParams.put("username", userName);
registerParams.put("psd", passWord);
return true;
}
}
最后,我们来运行一下,看看我们的效果,由于小编的genymotion不知道为什么不能运行了,所以委屈小伙伴们一下,看不了动态图片了,不过并不影响,我们首先用一个号码好注册一下,如下图所示:
看一下手机收到的验证码:
最后来看一下,我们的注册:
小编寄语:该博文,小编主要简单的介绍了如何通过手机获取验证码来完成注册的功能,以及如何利用正则表达式来验证码手机号码是否符合移动、联通、电信。还是那句话对于小编来说,既是挑战更是机遇,因为知识都是相通的,再者来说,在小编的程序人生中,留下最珍贵的记忆,虽然以后小编不一定从事安卓这个行业,代码世界里,很多种事,有的甜蜜,有的温馨,有的婉转成歌,有的绵延不息,在这些故事里,我们唯一的共通之处就是,某年,某月,某个波澜不惊的日子里,曾经很爱很爱你!爱你--这段实习的日子里,安卓带给小编的种种的惊喜。
Android Demo手机获取验证码的更多相关文章
- PHP注册手机获取验证码代码
php代码: <?php require dirname(__FILE__).'/include/common.inc.php';//这是在cms2008下面做的测试 header(" ...
- jquery 手机获取验证码计时
html: <input type="text" class="codeText" id="txtverifycode" /> ...
- Android中注册获取验证码倒计时按钮
public class CountDownTimerUtils extends CountDownTimer { private TextView mTextView; /** * @param t ...
- 【Android Demo】获取指定网页的页面源代码
1.直接上效果图 2.代码 主要就是工具类HtmlService.java: import java.io.ByteArrayOutputStream; import java.io.InputStr ...
- ajax实现手机获取验证码
<script type="text/javascript"> var InterValObj; //timer变量,控制时间 var count = 60; //间隔 ...
- 搜索----Android Demo
在前面的博客中,小编简单的介绍了,点击发现按钮,自动加载热门的相关数据,成长的脚步从不停歇,完成了发现的功能,今天我们来简单看一下如何在搜索栏中输入关键字,搜索出我们所需要的信息,今天这篇博文小编就简 ...
- Android实战简易教程-第四十一枪(显示倒计时的Button-适用于获取验证码)
近期在做获取验证码的功能.考虑到优良的用户体验,决定制作一个拥有倒计时提示的Button按钮,在网上查了一些资料,非常是简单的就能实现.我写了一个小Demo,大家能够应用到自己的项目中. 一.代码 1 ...
- 【风马一族_Android】Android 从命令行界面获取手机信息
Android 从命令行界面获取手机信息 1: cmd 打开命令行界面 2:adb devices 获取与电脑相连的设备,例如:模拟器.真机(手机) (右击“标记”,选择设备名称,点击“Ctrl+ ...
- 关于android各种双卡手机获取imei,imsi的处理(mtk,展讯,高通等)
目前国内对于双卡智能手机的需求还是很大的,各种复杂的业务会涉及到双卡模块:而android标准的api又不提供对双卡的支持.导致国内双卡模块标准混乱,各个厂商各玩各的.目前我知道的双卡解决方案就有:m ...
随机推荐
- hdu 3065 AC自动机(各子串出现的次数)
病毒侵袭持续中 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Sub ...
- spoj 1676 AC自动机+矩阵快速
Text Generator Time Limit: 1386MS Memory Limit: 1572864KB 64bit IO Format: %lld & %llu Submi ...
- hdu 1133 Buy the Ticket(Catalan)
Buy the Ticket Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) T ...
- Linux命令-关机命令详解
关机命令:1.halt 立刻关机 2.poweroff 立刻关机 3.shutdown -h now 立刻关机(root用户使用) 4.shutdown -h 10 10分钟后自动关机 如果是通过sh ...
- django rest-framework 2.请求和响应
一.请求对象 REST 框架引入Request来扩展常规的HttpRequest,并提供了更灵活的请求解析.Request对象的核心功能是request.data属性. 导入方式: from rest ...
- ml-agent:Win10下环境安装
这是我看到的最全面最详细的ml-agent讲解.(只用于学习与知识分享,如有侵权,联系删除.谢谢!) 来自CodeGize的个人博客 .源链接:https://www.cnblogs.com/Code ...
- AspNetCoreApi 跨域处理
AspNetCoreApi 跨域处理 如果咱们有处理过MV5 跨域问题这个问题也不大. (1)为什么会出现跨域问题: 浏览器安全限制了前端脚本跨站点的访问资源,所以在调用WebApi 接口时不能成功 ...
- .eslintrc 文件
安装 建议采用全局安装方式 npm install -g eslint 初始化 如果你的项目还没有配置文件(.eslintrc)的话,可以通过指定–init参数来生成一个新的配置文件: `eslint ...
- 用python来更改小伙伴的windows开机密码,不给10块不给开机
今天教大家用python脚本来控制小伙伴们windows电脑的开机密码.没错就是神不知鬼不觉,用random()随机生成的密码,只有你自己知道哦~ 代码呢分两部分,一部分是client端跟serv ...
- Kali安装使用文泉驿字体
安装文泉驿字体 Kali选择"简体中文"安装后,在终端等地方发现字体总有重叠,只要安装中文字体即可,这里推荐文泉驿字体.文泉驿是一个以开发开源.免费中文电子资源--如汉字字体.词库 ...