Day19 Django之Form表单验证、CSRF、Cookie、Session和Model操作
一、Form表单验证
用于做用户提交数据的验证
1.自定义规则
a、自定义规则(类,字段名==html中的name值)
b、数据提交-规则进行匹配
代码如下:
"""day19_django URL Configuration The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from app01 import views urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^login/', views.login),
]
urls.py
"""
Django settings for day19_django project. Generated by 'django-admin startproject' using Django 1.10.2. For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
""" import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'pv#lfw8ywtf=ws8mr%f9b)ihc0s@oj-2$wu^2o@)+(^)$i_9*n' # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app01',
] MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
] ROOT_URLCONF = 'day19_django.urls' TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')]
,
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
] WSGI_APPLICATION = 'day19_django.wsgi.application' # Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
} # Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
] # Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/ STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
settings.py
from django.shortcuts import render,HttpResponse
from django import forms
from django.forms.utils import ErrorDict
import json
from django.core.exceptions import ValidationError
import re def mobile_validate(value):
mobile_re = re.compile(r'^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$')
if not mobile_re.match(value):
raise ValidationError('手机号码格式错误') class LoginForm(forms.Form):
user = forms.CharField(required=True, error_messages={'required':'用户名不能为空'})
pwd = forms.CharField(required=True,
min_length=6,
max_length=12,
error_messages={'required':'密码必须不能为空',
'min_length':'至少6位',
'max_length':'最多12位'})
num = forms.IntegerField(error_messages={'required':'数字不能为空', 'invalid':'必须输入数字'})
#url = forms.EmailField()
phone = forms.CharField(validators=[mobile_validate, ],) def login(request):
if request.method == 'POST':
result = {'status':False, 'message':None}
obj = LoginForm(request.POST)
ret = obj.is_valid()
if ret:
print(obj.clean())
result['status'] = True
else:
print(type(obj.errors), obj.errors.as_json())
error_str = obj.errors.as_json()
result['message'] = json.loads(error_str)
return HttpResponse(json.dumps(result))
return render(request, 'login.html')
views.py
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.error-msg{
background-color: red;
}
</style>
</head>
<body>
<div>
<div>
<input type="text" name="user" />
</div>
<div>
<input type="text" name="num" />
</div>
<div>
<input type="text" name="phone" />
</div>
<div>
<input type="password" name="pwd" />
</div>
<input type="button" value="提交" onclick="DoSubmit();" />
</div>
<script src="/static/jquery-1.12.4.js"></script>
<script>
function DoSubmit() {
var dict_input = {};
$('input').each(function () {
var v = $(this).val();
var n = $(this).attr('name');
dict_input[n] = v;
});
console.log(dict_input);
$('.error-msg').remove();
$.ajax({
url:'/login/',
type:'POST',
data:dict_input,
dataType: 'json',
success:function (result) {
if(result.status){
location.href = '/index/';
}else{
$.each(result.message, function (k, v) {
console.log(k, v[0].message);
//<sapn class="error-msg">错误信息</span>
var tag = document.createElement('span');
tag.className = 'error-msg';
tag.innerText = v[0].message;
//input[name="user"]
$('input[name="' + k + '"]').after(tag);
})
} },
error:function () { }
})
}
</script>
</body>
</html>
login.html
2.用于做用户提交数据的验证 + 生成HTML标签
代码如下:
from django.shortcuts import render,HttpResponse
from django import forms
from django.forms.utils import ErrorDict
import json
from django.core.exceptions import ValidationError
import re def mobile_validate(value):
mobile_re = re.compile(r'^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$')
if not mobile_re.match(value):
raise ValidationError('手机号码格式错误') class LoginForm(forms.Form):
user = forms.CharField(required=True, error_messages={'required':'用户名不能为空'})
pwd = forms.CharField(required=True,
min_length=6,
max_length=12,
error_messages={'required':'密码必须不能为空',
'min_length':'至少6位',
'max_length':'最多12位'})
num = forms.IntegerField(error_messages={'required':'数字不能为空', 'invalid':'必须输入数字'})
#url = forms.EmailField()
phone = forms.CharField(validators=[mobile_validate, ],)
#生成input标签,并加属性,设置样式
#test = forms.CharField(widget=forms.TextInput(attrs={'k1':'123','class':'error-msg'}))
#生成下拉列表,真正提交数据还是数字
test_choices = {
(0, '上海'),
(1, '北京'),
}
test = forms.IntegerField(widget=forms.Select(choices=test_choices))
def login(request):
if request.POST:
objPost = LoginForm(request.POST)
ret = objPost.is_valid()
if ret:
print(objPost.clean())
else:
#obj1.errors是ErrorDict,ErrorDict继承dict
# for k,v in objPost.errors.items():
# print(k, v)
# print(objPost.errors['phone'][0])
# print(objPost.errors['user'][0])
# print(objPost.errors['num'][0])
pass
return render(request, 'login.html', {'obj1': objPost})
else:
objGet = LoginForm()
return render(request, 'login.html', {'obj1':objGet})
views.py
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.error-msg{
background-color: red;
}
</style>
</head>
<body>
<form action="/login/" method="POST">
<div>
<div>
{{ obj1.user }}
{% if obj1.errors.user %}
<span class="error-msg">{{ obj1.errors.user.0 }}</span>
{% endif %}
</div>
<div>
{{ obj1.pwd }}
{% if obj1.errors.pwd %}
<span class="error-msg">{{ obj1.errors.pwd.0 }}</span>
{% endif %}
</div>
<div>
{{ obj1.num }}
{% if obj1.errors.num %}
<span class="error-msg">{{ obj1.errors.num.0 }}</span>
{% endif %}
</div>
<div>
{{ obj1.phone }}
{% if obj1.errors.phone %}
<span class="error-msg">{{ obj1.errors.phone.0 }}</span>
{% endif %}
</div>
<div>
{{ obj1.test }}
</div>
<input type="submit" value="提交" />
</div>
</form>
</body>
</html>
login.html
二、CSRF
django为用户实现防止跨站请求伪造的功能,通过中间件 django.middleware.csrf.CsrfViewMiddleware 来完成。而对于django中设置防跨站请求伪造功能有分为全局和局部。
全局:
中间件 django.middleware.csrf.CsrfViewMiddleware
局部:
- @csrf_protect,为当前函数强制设置防跨站请求伪造功能,即便settings中没有设置全局中间件。
- @csrf_exempt,取消当前函数防跨站请求伪造功能,即便settings中设置了全局中间件。
注:from django.views.decorators.csrf import csrf_exempt,csrf_protect
"""day19_django URL Configuration The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from app01 import views urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^login/', views.login),
url(r'^csrf/', views.csrf),
]
urls.py
from django.shortcuts import render,HttpResponse
from django import forms
from django.forms.utils import ErrorDict
import json
from django.core.exceptions import ValidationError
import re def mobile_validate(value):
mobile_re = re.compile(r'^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$')
if not mobile_re.match(value):
raise ValidationError('手机号码格式错误') class LoginForm(forms.Form):
user = forms.CharField(required=True, error_messages={'required':'用户名不能为空'})
pwd = forms.CharField(required=True,
min_length=6,
max_length=12,
error_messages={'required':'密码必须不能为空',
'min_length':'至少6位',
'max_length':'最多12位'})
num = forms.IntegerField(error_messages={'required':'数字不能为空', 'invalid':'必须输入数字'})
#url = forms.EmailField()
phone = forms.CharField(validators=[mobile_validate, ],)
#生成input标签,并加属性,设置样式
#test = forms.CharField(widget=forms.TextInput(attrs={'k1':'123','class':'error-msg'}))
#生成下拉列表,真正提交数据还是数字
test_choices = {
(0, '上海'),
(1, '北京'),
}
test = forms.IntegerField(widget=forms.Select(choices=test_choices))
def login(request):
if request.POST:
objPost = LoginForm(request.POST)
ret = objPost.is_valid()
if ret:
print(objPost.clean())
else:
#obj1.errors是ErrorDict,ErrorDict继承dict
# for k,v in objPost.errors.items():
# print(k, v)
# print(objPost.errors['phone'][0])
# print(objPost.errors['user'][0])
# print(objPost.errors['num'][0])
pass
return render(request, 'login.html', {'obj1': objPost})
else:
objGet = LoginForm()
return render(request, 'login.html', {'obj1':objGet}) def csrf(request):
return render(request, 'csrf.html')
views.py
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<!--form提交-->
<form action="/csrf/" method="POST">
{% csrf_token %}
<input type="text" name="v" />
<input type="submit" value="提交" />
</form> <input type="button" value="Ajax提交" onclick="DoAjax();" />
<!--ajax提交-->
<script src="/static/jquery-2.1.4.min.js"></script>
<script src="/static/jquery.cookie.js"></script>
<script>
//获取cookie
var csrftoken = $.cookie('csrftoken'); function csrfSafeMethod(method) {
// these HTTP methods do not require CSRF protection
return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
}
$.ajaxSetup({
beforeSend: function(xhr, settings) {
if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
xhr.setRequestHeader("X-CSRFToken", csrftoken);
}
}
}); function DoAjax() {
$.ajax({
url:'/csrf/',
type:'POST',
data:{'k1':'v1'},
success: function (data) {
console.log(data);
}
})
}
</script>
</body>
</html>
csrf.html
三、Cookie和Session
Cookie保存在客户端浏览器上的一个容器,独立存在
服务器上保存的是session(内存或数据库或缓存),依赖Cookie
"""day19_django URL Configuration The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from app01 import views urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^login/', views.login),
url(r'^csrf/', views.csrf),
url(r'^cookie/', views.cookie),
url(r'^cookie1/', views.cookie),
url(r'^log/', views.log),
url(r'^index/', views.index),
url(r'^session_login/', views.session_login),
url(r'^session_index/', views.session_index),
url(r'^session_logout/', views.session_logout),
]
urls.py
from django.shortcuts import render,HttpResponse,redirect
from django import forms
from django.forms.utils import ErrorDict
import json
from django.core.exceptions import ValidationError
import re
from django.views.decorators.csrf import csrf_exempt,csrf_protect
def mobile_validate(value):
mobile_re = re.compile(r'^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$')
if not mobile_re.match(value):
raise ValidationError('手机号码格式错误') class LoginForm(forms.Form):
user = forms.CharField(required=True, error_messages={'required':'用户名不能为空'})
pwd = forms.CharField(required=True,
min_length=6,
max_length=12,
error_messages={'required':'密码必须不能为空',
'min_length':'至少6位',
'max_length':'最多12位'})
num = forms.IntegerField(error_messages={'required':'数字不能为空', 'invalid':'必须输入数字'})
#url = forms.EmailField()
phone = forms.CharField(validators=[mobile_validate, ],)
#生成input标签,并加属性,设置样式
#test = forms.CharField(widget=forms.TextInput(attrs={'k1':'123','class':'error-msg'}))
#生成下拉列表,真正提交数据还是数字
test_choices = {
(0, '上海'),
(1, '北京'),
}
test = forms.IntegerField(widget=forms.Select(choices=test_choices))
def login(request):
if request.POST:
objPost = LoginForm(request.POST)
ret = objPost.is_valid()
if ret:
print(objPost.clean())
else:
#obj1.errors是ErrorDict,ErrorDict继承dict
# for k,v in objPost.errors.items():
# print(k, v)
# print(objPost.errors['phone'][0])
# print(objPost.errors['user'][0])
# print(objPost.errors['num'][0])
pass
return render(request, 'login.html', {'obj1': objPost})
else:
objGet = LoginForm()
return render(request, 'login.html', {'obj1':objGet}) #@csrf_protect 强制给函数加csrf验证 @csrf_exempt
#不用做csrf验证
def csrf(request): return render(request, 'csrf.html') #使用Cookie做登录认证
def cookie(request):
print(request.COOKIES)
obj = render(request, 'cookie.html')
#path='/cookie/',Cookie存放路径
obj.set_cookie('k3','v3',path='/cookie/')
return obj def cookie1(request):
print(request.COOKIES)
obj = render(request, 'cookie.html')
#path='/',Cookie全局生效
obj.set_cookie('k1','v1',path='/')
return obj def log(request):
if request.method == 'POST':
u = request.POST.get('user')
p = request.POST.get('pwd')
if u == 'alex' and p == '':
print(u)
red = redirect('/index/')
red.set_cookie('username', u)
return red
else:
return render(request, 'log.html')
else:
return render(request, 'log.html') def index(request):
user = request.COOKIES.get('username')
if user:
return render(request, 'index.html', {'user':user})
else:
return redirect('/log/') #使用session做登录认证
USER_LIST = ['alex','eric','wang','liu']
def session_login(request):
if request.method == 'POST':
u = request.POST.get('user')
p = request.POST.get('pwd')
if u in USER_LIST and p == '':
request.session['user'] = u
return redirect('/session_index/')
return render(request, 'session_login.html') """
def session_index(request):
user = request.session.get('user', None)
if not user:
return redirect('/session_login/')
else:
return render(request, 'session_index.html', {'user':user})
"""
def auth(func):
def inner(request, *args, **kwargs):
#print(request, args, kwargs)
user = request.session.get('user', None)
if not user:
return redirect('/session_login/')
return func(request, *args, **kwargs)
return inner @auth
def session_index(request):
user = request.session.get('user', None)
return render(request, 'session_index.html', {'user':user}) @auth
def session_logout(request):
del request.session['user']
return redirect('/session_login/')
views.py
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form action="/session_login/" method="POST">
<input type="text" name="user">
<input type="text" name="pwd">
<input type="submit" value="提交" />
</form>
</body>
</html>
session_login.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form action="/session_login/" method="POST">
<input type="text" name="user">
<input type="text" name="pwd">
<input type="submit" value="提交" />
</form>
</body>
</html>
session_index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form action="/log/" method="POST">
<input type="text" name="user">
<input type="text" name="pwd">
<input type="submit" value="提交" />
</form>
</body>
</html>
log.html
四、Model操作
a.基本
b.进阶
c.双下划线
__大于小于操作
__可以跨表 class UserInfo(models.Model):
user = models.CharField(max_length=32)
pwd = models.CharField(max_length=32)
queryset = UserInfo.objects.all() print(queryset.query) --SQL语句
[UserInfo对象,UserInfo对象,UserInfo对象,] queryset = UserInfo.objects.all().values('user')
[{'user':'alex'},{'user':'eric'}] queryset = UserInfo.objects.all().value_list('user')
[('alex'),('eric')] =======================================================
一对多
class UserType(models.Model):
caption = models.CharField(max_length=32)
#超级管理员、普通用户、访客、黑客 class UserInfo(models.Model):
user = models.CharField(max_length=32)
pwd = models.CharField(max_length=32)
user_type = models.ForeignKey('UserType')
#user_type_id #创建UserInfo
1、UserInfo.objects.create(user='alex',pwd='',user_type=UserType.objects.get(id=2))
或:
2、UserInfo.objects.create(user='alex',pwd='',user_type_id=2) #查询
UserInfo.objects.filter(user='alex')
1、查询所有用户类型为普通用户的所有用户名和密码
uid = UserType.objects.get(caption='普通用户').id
UserInfo.objects.filter(user_type_id=uid)
或:
queryset = UserInfo.objects.filter(user_type__caption='普通用户') -- 跨表使用双下划线
[UserInfo对象,UserInfo对象,UserInfo对象,]
row = queryset[0]
row.user
row.pwd
row.user_type -- user_type对象
row.user_type.id
row.user_type.caption
###### objects __
###### row.外键字段.外键表的字段 queryset = UserInfo.objects.filter(user_type__caption='普通用户').values('user', 'user_type__caption') -- 跨表使用双下划线
[{'user':'alex','user_type__caption':'普通用户'},{'user':'eric','user_type__caption':'普通用户'}]
row = queryset[0]
row['user']
row['user_type__caption'] 多张表
class Something(models.Model):
name = models.CharField(max_length=32) class UserType(models.Model):
caption = models.CharField(max_length=32)
st = models.ForeignKey('Something')
#超级管理员、普通用户、访客、黑客 class UserInfo(models.Model):
user = models.CharField(max_length=32)
pwd = models.CharField(max_length=32)
user_type = models.ForeignKey('UserType')
#user_type_id UserInfo.objects.filter(user_type__st__name='xx')
Day19 Django之Form表单验证、CSRF、Cookie、Session和Model操作的更多相关文章
- python_way day19 HTML-day5 (form表单验证,CSRF,cookie,session,缓存)
python-way day19 1. dJango的form表单验证 2.CSRF 跨站请求伪造 3.cookie,session 4.缓存 一,django表单验证功能 1.django验证基础: ...
- Django 11 form表单(状态保持session、form表单及注册实现)
Django 11 form表单(状态保持session.form表单及注册实现) 一.状态保持 session 状态保持 #1.http协议是无状态的:每次请求都是一次新的请求,不会记得之前通信的状 ...
- web框架-(六)Django补充---form表单验证
一.form表单验证 1. 常规html页面的form表单验证 常规页面中,如果想实现对表单中用户输入信息的数据验证,需要配合Ajax来实现. 使用前我们先来熟悉下函数参数:request,其中包含的 ...
- django之form表单验证
django中的Form一般有两种功能: 输入html 验证用户输入 #!/usr/bin/env python # -*- coding:utf- -*- import re from django ...
- Django的Form表单验证
Form(from django import forms) 简短理解:后端提供了一个类:from django import forms,继承此类定义子类.子类中定义和form表单中提交到name名 ...
- Django之form表单验证顺序
概述 django框架提供了一个forms类,来处理web开发中的表单相关事项.众所周知,form最常做的是对用户输入的内容进行验证,为此django的forms类提供了全面的内容验证支持. 验证过程 ...
- Django中的Form表单验证
回忆一下Form表单验证的逻辑: 前端有若干个input输入框,将用户输入内容,以字典传递给后端. 后端预先存在一个Form表单验证的基类,封装了一个检测用户输入是否全部通过的方法.该方法会先定义好错 ...
- 6.4-6.5 使用form表单验证,完善登录页面
之前是使用自定义的类来实现登录逻辑,现在使用django内置的form表单验证,用继承django的view来实现登录页面. users > views.py 的内容是: from django ...
- Django(5) session登录注销、csrf及中间件自定义、django Form表单验证(非常好用)
一.Django中默认支持Session,其内部提供了5种类型的Session供开发者使用: 数据库(默认) 缓存 文件 缓存+数据库 加密cookie 1.数据库Session 1 2 3 4 5 ...
随机推荐
- 5种Web常见编码、变换算法的自动识别
#coding=utf-8 #识别字符序列变换算法,当前支持标准的MD5.SHA-1.Base64,及主流的URL编码.HTML编码 import re import sys #MD5判断函数 def ...
- Sublime ctags 函数跳转插件安装
Sublime Text安装插件的方法,主要有以下两种: 1. 直接通过下载安装包安装 在编辑器菜单中点击“Preferences”–“Browse Packages…”打开插件安装目录,然后把下载的 ...
- 无法定位序数XX于动态链接库XX.dll的解决的方法
问题阐述: 开发环境:VS2008 使用RELEASE生成了可执行文件,发如今某些电脑上能够正常执行,但在部分电脑中执行失败提示:无法定位序数8523于动态链接库mfc90.dll 在网上查找了一些资 ...
- JQuery Kendo UI使用技巧总结
Kendo UI开发总结 By Gloomyfish on 2013-04-25 在Grid中支持分页刷新: scrollable: {virtual : true }, 在Gr ...
- hdu1864 最大报销额(01背包)
转载请注明出处:http://blog.csdn.net/u012860063 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1864 Problem ...
- iOS 应用性能测试的相关方法、工具及技巧
用户不喜欢等待.他们不关心也不应该关心一个应用初始化的时候需要什么,他们只想尽快地完成他们的任务.你的应用应该几乎是瞬间启动的,其界面应当如丝般顺滑.在充满竞争的软件市场中,应用的性能是关键的优势之一 ...
- java 窗口的一些示例代码,可直接运行
代码链接如下: http://pan.baidu.com/s/1gdlCI4N 有应用SWING,也有应用AWT,可视情况而定. 窗口程序运行需要jdk1.7环境(测试可用).
- SQL Server 2005恢复数据库详细图文教程
不少需要用到sql2005的程序,有很多新手还是会操作,这里写个详细的图文教程送个菜鸟们,高手请飘过.适用于独立主机的朋友使用,如果你还没安装,请按照这个教程来安装 SQL Server 2005图文 ...
- Google Map API v2 (四)----- 导航路径
仍然是建议个异步小任务 private GetPathTask mGetPathTask = null; private void getGuidePath(LatLng origin){ if(mG ...
- Windows2012中安装域控(DC) + SQL Server 2014 + TFS 2015
安装域控(DC) 修改计算机名 修改固定IP 添加角色 选择“Role-based or feature-based installation” 选择本机 选择“Active Directory Do ...