2013-0801

戴黑帽子的人常被视为恶棍或坏人。在西方电影中,反派角色都会带着黑色的帽子。而在计算机领域中,这个词被用在黑客身上,黑客们的盛会则被称为“黑帽大会”。黑帽大会自1997年创立以来,引领安全思想和技术走向。参会人员包括企业和政府的研究人员,甚至还有一些民间团队。黑帽大会被认为是世界上最好的能够了解未来安全趋势的信息峰会,它的权威性自不必说。

今年7月27日到8月1日,黑帽大会在美国的拉斯维加斯举办 阅读全文>>

揭秘黑帽大会:黑客们的“海天盛筵”

标签: 黑帽 黑帽大会 阅读:9784
2013-0730

MVC使用Ajax.BeginForm上传图片时HttpPostedFileBase file为null,Request.Files获取不到文件,问题分析是页面中存在jquery.unobtrusive-ajax.js文件,注释后能够获取到。改为Html.BeginForm实现如下:

@using (Html.BeginForm("UploadPhoto", "EditUserInfo", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
选择图片:
<input type="file" name="uploa 阅读全文>>
                
标签: mvc Ajax.BeginForm HttpPostedFileBase 图片上传 文件上传 阅读:37399
2013-0730

百度接口相关说明:http://developer.baidu.com/map/ip-location-api.htm

返回是json格式,首先构建相关反系列化类:

#region AddressForQueryIPFromBaidu
[Serializable]
public class AddressForQueryIPFromBaidu
{
    public string Address { get; set; }
    public Content Content { get; set;  阅读全文>>
                
标签: C# 百度API 通过IP获取位置 IP获取坐标 阅读:22129
2013-0730

正则表达式用于字符串处理、表单验证等场合,实用高效。现将一些常用的表达式收集于此,以备不时之需。

匹配中文字符的正则表达式: [\u4e00-\u9fa5]
评注:匹配中文还真是个头疼的事,有了这个表达式就好办了

匹配双字节字符(包括汉字在内):[^\x00-\xff]
评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)

匹配空白行的正则表达式:\n\s*\r
评注:可... 阅读全文>>

标签: 常用正则表达式 Email正则表达式 URL正则表达式 电话正则表达式 身份证正则表达式 阅读:9594
2013-0725

在asp.net mvc的强类型视图(strongly typed view)使用下拉列表,在Controller中设定的选择项在View上选中失效


下面是我的代码:

public ActionResult Create(int id=0,int parentid=0)
{
    var productCategory=db.ProductCategorys.Where(pc => pc.ParentID == parentid).ToList();
    productCategory.Insert(0,new ProductCategoryModel() { Name = "顶级分 阅读全文>>
                
标签: ASP.NET MVC SelectList selected 阅读:11122
2013-0724

mvc使用Area分区开发后,存在在不同Area间跳转,需要为每个区间添加Area规则,如下:

public class CompanyAreaRegistration : AreaRegistration
{
    public override string AreaName
    {
        get
        {
            return "Company";
        }
    }
    public override void RegisterArea(AreaRegistrationContext context)
    {
        context 阅读全文>>
                
标签: ASP.NET MVC RedirectToAction Area 阅读:20224