苹果宣布 2017 年 1 月 1 日开始所有上架的应用必须启用 ATS 安全传输功能。ATS 要求服务器必须支持传输层安全(TLS)协议 1.2 以上版本;证书必须使用 SHA256 或更高的哈希算法签名;必须使用 2048 位以上 RSA 密钥或 256 位以上 ECC 算法等等,不满足条件的证书,ATS 都会拒绝连接。查看具体要求
微信小程序进入开发公测阶段,同样要求提供 HTTPS 方式安全连接。
证书类型对比
| DV SSL 域名验证型 | OV SSL 组织验证型 | EV SSL 扩展验证型 | ||
| 申请条件 | 申请对象 | 个人 / 企业 | 企业 | 企业 |
| 证明域名所有权 | √ | √ | √ | |
| 价格 | 免费 / 低 | 中 | 高 | |
| 提交审核 | 提交资料 | 邮箱、姓名、手机等 | DV 所需资料以及: 组织机构资料(企业执照)等 | OV 所需资料以及: 法律相关文件 |
| 审核时间 | 自动审核 1小时内 | 人工审核 3~5工作日 | 人工审核 3~5工作日 | |
| 可信标识 | 地址栏挂锁 | √ | √ | √ |
| 地址栏公司名称 | × | × | √ | |
| 绿色地址栏(IE) | × | × | √ | |
| 保护范围 | 单域名 | √ | √ | √ |
| 多域名 | √ | √ | √ | |
| 通配符/泛域名 | √ | √ | × | |
| 推荐用途 | 个人及小型网站 | 一般组织或中小型企业 | 金融、电商、大型企业或受信组织 | |
* 表格中,单域名指单个子域名(如:123.abc.com),多域名指多个子域名(可以不属于同一个顶级域名,如:123.abc.com / 456.abc.com / 456.def.com),通配符指单个顶级域名的所有子域名(如:*.abc.com)。
* 若 https 的网页中包含 http 资源,则地址栏的锁可能会消失。
* 浏览器上点击地址栏的锁可以查看具体的证书详情。
证书颁发机构(CA)
| 机构 | 简介 | 谁在用 |
| Let's Encrypt | 公益组织,免费,每 90 天续约 | 越来越多的中小网站 |
| Symantec | 赛门铁克 | 百度、支付宝、阿里云、Apple(EV)、微软 |
| GlobalSign | 公众信任服务行业的领头羊 | 淘宝、天猫(OV)、阿里云、京东(OV) |
| GeoTrust | 全球第二大? | 微信 |
| Comodo | 价格实惠 | |
| GoDaddy | 全球互联网域名注册商 | |
| DigiCert | 不颁发 DV,在非 DV 市场份额中是老大 | Facebook、Twitter(EV)、Mozilla(EV)、GitHub(EV)等 |
| 沃通 WoSign | 国产 | 360搜索(EV) |
| Other |
* 赛门铁克收购了 VeriSign,VeriSign 又收购了 GeoTrust,所以 Symantec 和 GeoTrust 在 SSL 认证服务上就不知道是什么关系了,请自行百度。
* 代理商也可以购买,或许价格优惠,或许申请方便,如:阿里云、腾讯云等,甚至上淘宝购买。
* 查看:Netcraft 统计的市场份额
* 网上说使用 Let's Encrypt 的 SSL 在遇到国内第三方 DNS 解析服务时会超时,我认为只是在申请证书时偶尔超时(DNS query timed out),重试即可,证书部署后访问网站时应该没有问题,请知情者告知实情。
下一步
先上代码
DataClassesXDataContext db = new DataClassesXDataContext();
// 使用 let 关键字
DateTime dt = DateTime.Now;
var q1 = (from z in db.dtZone
let adCount = db.dtAD.Count(ad => ad.iZone == z.ID)
select new
{
z.ID,
adCount,
}).Take(10).ToList();
Response.Write((DateTime.Now - dt) + "<br />");
// 先 Select 后 Take
dt = DateTime.Now;
var q2 = (from z in db.dtZone
select new
{
z.ID,
adCount = db.dtAD.Count(ad => ad.iZone == z.ID),
}).Take(10).ToList();
Response.Write((DateTime.Now - dt) + "<br />");
// 先 Take 后 Select
dt = DateTime.Now;
var q3 = (from z in db.dtZone
select new { z.ID }).Take(10).ToList().Select(z => new
{
z.ID,
adCount = db.dtAD.Count(ad => ad.iZone == z.ID),
}).ToList();
Response.Write((DateTime.Now - dt) + "<br />");在一个有 365 行记录的 dtZone 表和 5700 行记录的 dtAD 的数据库中进行嵌套查询(远程),同样取 10 条 dtZone 记录及对应的 dtAD 数,结果表明前两种执行时间相差无几,第二种略快,但第三种由于进行了多次查询,消耗的时间接近于前两种的 10 倍。结果仅供参考。
jQuery 请求代码:
$.ajax({
url: "xxxxxx",
//method: "GET", // 默认 GET(当 dataType 为 jsonp 时此参数无效,始终以 GET 方式请求)
data: $('#myForm').serialize(), // 要传递的参数,这里提交表单 myForm 的内容
dataType: "jsonp"
//, jsonp: "callback" // 请求中的回调函数的参数名,默认值 callback
//, jsonpCallback: "jQuery_abc" // 本地回调函数名,不指定则随机
})
.done(function () {
alert("done");
if (true) {
$('#myForm')[0].reset();
}
})
.fail(function () { alert("fail"); })
.always(function () { alert("complete"); });
ASP.NET 处理代码:
JavaScriptSerializer jss = new JavaScriptSerializer();
string json = jss.Serialize(new { result = new { success = true, msg = "成功" } });
if (!string.IsNullOrWhiteSpace(Request["callback"])
&& Regex.IsMatch(Request["callback"], @"[_$a-zA-Z][$\w]*"))
{
Response.ContentType = "application/javascript; charset=utf-8";
Response.Write(json + Request["callback"] + "(" + json + ")");
}
else
{
Response.ContentType = "application/json; charset=utf-8";
Response.Write(json);
}
Response.End();
evasi0n 是由 pod2g、planetbeing、pimskeks、肌肉男四名黑客组成的 evad3rs 越狱梦之队发布的 iOS6 完美越狱工具。可以完美越狱 iOS6.0、iOS6.0.1、iOS6.0.2、iOS6.1、iOS6.1.1 和 iOS6.1.2 等多个固件版本的所有 iOS6 设备(AppleTV 除外)。
下载地址:http://evasi0n.com/
p:first-line 段落中的第一行文本
p:first-lette 段落中的第一个字母
p.view{color:green; font-size:12px}
p.view:first-line{color:yellow; font-size:12px}
p.view:first-letter{color:red; font-size:24px}
</STYLE>
<P class=view>中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国</P>
<P class=view>abcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefg</P>
效果:
中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国
abcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefg
在母板页"CS"加入:
{
get
{
return HyperLink3;
}
set
{
HyperLink3 = value;
}
}
在子页"源"加入:
即可在子页重写它:
但最好放在Page_LoadComplete:
{
}
string chkCode = string.Empty;
//颜色列表,用于验证码、噪线、噪点
//Color[] color ={Color.White, Color.Yellow, Color.LightBlue, Color.LightGreen,
// Color.Orange, Color.LightCyan, Color.LightPink,
// Color.LightSalmon };
Color[] color = {Color.Black, Color.Blue, Color.Red, Color.DarkViolet,
Color.Chocolate, Color.DarkGreen, Color.DeepSkyBlue,
Color.DarkCyan };
//字体列表,用于验证码
string[] font = {"Times New Roman", "MS Mincho", "Book Antiqua", "Gungsuh",
"PMingLiU", "Impact" };
//验证码的字符集,去掉了一些容易混淆的字符
char[] character ={'2', '3', '4', '5', '6', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'R', 'S', 'T',
'W', 'X', 'Y' };
Random rnd = new Random();
//生成验证码字符串
for (int i = 0; i < 4; i++)
{
chkCode += character[rnd.Next(character.Length)];
}
//把验证码存入session
Session["chkCode"] = chkCode;
Bitmap bmp = new Bitmap(65, 20);
Graphics g = Graphics.FromImage(bmp);
g.Clear(Color.Transparent);//背景色
//画噪线
for (int i = 0; i < 0; i++)
{
int x1 = rnd.Next(65);
int y1 = rnd.Next(20);
int x2 = rnd.Next(65);
int y2 = rnd.Next(20);
Color clr = color[rnd.Next(color.Length)];
g.DrawLine(new Pen(clr), x1, y1, x2, y2);
}
//画验证码字符串
for (int i = 0; i < chkCode.Length; i++)
{
string fnt = font[rnd.Next(font.Length)];
Font ft = new Font(fnt, 15);
Color clr = color[rnd.Next(color.Length)];
g.DrawString(chkCode[i].ToString(), ft, new SolidBrush(clr),
(float)i * 15 + 2, (float)0);
}
//画噪点
for (int i = 0; i < 50; i++)
{
int x = rnd.Next(bmp.Width);
int y = rnd.Next(bmp.Height);
Color clr = color[rnd.Next(color.Length)];
bmp.SetPixel(x, y, clr);
}
//清除该页输出缓存,设置该页无缓存
Response.Buffer = true;
Response.ExpiresAbsolute = System.DateTime.Now.AddMilliseconds(0);
Response.Expires = 0;
Response.CacheControl = "no-cache";
Response.AppendHeader("Pragma", "No-Cache");
//将验证码图片写入内存流,并将其以 "image/Png" 格式输出
MemoryStream ms = new MemoryStream();
try
{
bmp.Save(ms, ImageFormat.Png);
Response.ClearContent();
Response.ContentType = "image/Png";
Response.BinaryWrite(ms.ToArray());
}
finally
{
//显式释放资源
bmp.Dispose();
g.Dispose();
}
CatalogEdit.aspx
<asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSource1" DataTextField="catalog" DataValueField="ID" Rows="10"></asp:ListBox> <asp:LinkButton ID="LinkButton_up" runat="server" OnClick="LinkButton_up_Click">上移</asp:LinkButton> <asp:LinkButton ID="LinkButton_down" runat="server" OnClick="LinkButton_down_Click">下移</asp:LinkButton> <asp:LinkButton ID="LinkButton_del" runat="server" OnClick="LinkButton_del_Click">删除</asp:LinkButton> <asp:Label ID="Label_alert" runat="server" ForeColor="Red" Text="Label"></asp:Label><br /> <asp:TextBox ID="TextBox_newCatalog" runat="server"></asp:TextBox> <asp:LinkButton ID="LinkButton_add" runat="server" OnClick="LinkButton_add_Click">新增</asp:LinkButton> <asp:LinkButton ID="LinkButton_edit" runat="server" OnClick="LinkButton_edit_Click">修改</asp:LinkButton> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringLink %>" DeleteCommand="DELETE FROM [xLinkCategory] WHERE [ID] = ?" InsertCommand="INSERT INTO [xLinkCategory] ([username],[catalog],[order]) VALUES (?,?,0)" ProviderName="<%$ ConnectionStrings:ConnectionStringLink.ProviderName %>" SelectCommand="SELECT [ID], [catalog] FROM [xLinkCategory] WHERE ([username] = ?) ORDER BY [order],[ID] desc" UpdateCommand="UPDATE [xLinkCategory] SET [catalog] = ? WHERE [ID] = ?"> <DeleteParameters> <asp:Parameter Name="ID" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="catalog" Type="String" /> <asp:Parameter Name="ID" Type="Int32" /> </UpdateParameters> <SelectParameters> <asp:SessionParameter Name="username" SessionField="username" Type="String" /> </SelectParameters> <InsertParameters> <asp:SessionParameter Name="username" SessionField="username" Type="String" /> <asp:Parameter Name="catalog" Type="String" /> </InsertParameters> </asp:SqlDataSource>
CatalogEdit.aspx.cs
/**//// <summary>
/// 上移
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void LinkButton_up_Click(object sender, EventArgs e)
{
if (ListBox1.SelectedItem != null && ListBox1.SelectedIndex > 0)
{
string tempValue = ListBox1.SelectedValue;
string tempText = ListBox1.SelectedItem.Text;
int index = ListBox1.SelectedIndex;
ListBox1.SelectedItem.Value = ListBox1.Items[index - 1].Value;
ListBox1.SelectedItem.Text = ListBox1.Items[index - 1].Text;
ListBox1.Items[index - 1].Value = tempValue;
ListBox1.Items[index - 1].Text = tempText;
ListBox1.SelectedIndex--;
operateDB_move();
}
}
/**//// <summary>
/// 下移
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void LinkButton_down_Click(object sender, EventArgs e)
{
if (ListBox1.SelectedItem != null && ListBox1.SelectedIndex < ListBox1.Items.Count - 1)
{
string tempValue = ListBox1.SelectedValue;
string tempText = ListBox1.SelectedItem.Text;
int index = ListBox1.SelectedIndex;
ListBox1.SelectedItem.Value = ListBox1.Items[index + 1].Value;
ListBox1.SelectedItem.Text = ListBox1.Items[index + 1].Text;
ListBox1.Items[index + 1].Value = tempValue;
ListBox1.Items[index + 1].Text = tempText;
ListBox1.SelectedIndex++;
operateDB_move();
}
}
/**//// <summary>
/// 添加
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void LinkButton_add_Click(object sender, EventArgs e)
{
if (TextBox_newCatalog.Text != "")
{
//检查同名
bool goon = true;
foreach (ListItem li in ListBox1.Items)
{
if (li.Text == TextBox_newCatalog.Text)
{
goon = false;
}
}
if (goon)
{
//操作
SqlDataSource1.InsertParameters["catalog"].DefaultValue = TextBox_newCatalog.Text;
SqlDataSource1.Insert();
//设置selected
if (ListBox1.Items.Count > 0)
{
ListBox1.SelectedIndex = 0;
}
}
else
{
Label_alert.Text = "已存在";
}
}
}
/**//// <summary>
/// 修改
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void LinkButton_edit_Click(object sender, EventArgs e)
{
if (TextBox_newCatalog.Text != "" && ListBox1.SelectedItem != null)
{
int index = ListBox1.SelectedIndex;
//检查同名
bool goon = true;
foreach (ListItem li in ListBox1.Items)
{
if (li.Text == TextBox_newCatalog.Text)
{
goon = false;
}
}
if (goon)
{
//操作
SqlDataSource1.UpdateParameters["catalog"].DefaultValue = TextBox_newCatalog.Text;
SqlDataSource1.UpdateParameters["ID"].DefaultValue = ListBox1.SelectedItem.Value;
SqlDataSource1.Update();
//设置selected
ListBox1.SelectedIndex = index;
}
else
{
Label_alert.Text = "已存在";
}
}
}
/**//// <summary>
/// 删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void LinkButton_del_Click(object sender, EventArgs e)
{
if (ListBox1.SelectedItem != null)
{
int index = ListBox1.SelectedIndex;
int count = ListBox1.Items.Count;
//检查该 Catalog 下是否有 Link
bool goon = true;
goon = !checkSubLink(ListBox1.SelectedValue); //下有 Link 则返回真,注意前面有个"!",有则不继续
if (goon)
{
//操作
SqlDataSource1.DeleteParameters["ID"].DefaultValue = ListBox1.SelectedItem.Value;
SqlDataSource1.Delete();
//设置selected
if (index < count - 1) //删的不是最末项
{
ListBox1.SelectedIndex = index;
}
if (index == count - 1 && index != 0) //删的是最末项,并且不是最首项
{
ListBox1.SelectedIndex = index - 1;
}
if (index == count - 1 && index == 0) //删的是最末项,并且是最首项
{
//不设索引
}
}
else
{
Label_alert.Text = "该节点下面存在Link(s),请删除后再删除该节点!";
}
}
}