HTTP Status 500- 怎么解决
500是服务器内部错误。
一般是你的程序出错了,也可能是配置错误,可以检查日志文件了解详情。不同的后端语言和服务器检查方法也有不同,但是对照日志文件可以发现出错的地方。
求验证码的代码,要求背景有斑斑点点,显示的数字或字母要有大小颜色字体的差异
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;
public partial class CheckCode : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability( HttpCacheability.NoCache );
Session[“CheckCode“] = GenerateCheckCode();
this.CreateCheckCodeImage(GenerateCheckCode());
Response.Cache.SetAllowResponseInBrowserHistory(false);
}
private string GenerateCheckCode()
{
int number;
char code;
string checkCode = String.Empty;
System.Random random = new Random();
for (int i = 0; i 《 5; i++)
{
number = random.Next();
if (number % 2 == 0)
code = (char)(’1’ + (char)(number % 9));
else
code = (char)(’A’ + (char)(number % 26));
checkCode += code.ToString();
}
//Response.Cookies.Add(new HttpCookie(“CheckCode“, checkCode));
return checkCode;
}
private void CreateCheckCodeImage(string checkCode)
{
if (checkCode == null || checkCode.Trim() == String.Empty)
return;
System.Drawing.Bitmap image = new System.Drawing.Bitmap((int)Math.Ceiling((checkCode.Length * 13.5)), 25);
Graphics g = Graphics.FromImage(image);
try
{
//生成随机生成器
Random random = new Random();
//清空图片背景色
g.Clear(Color.White);
//画图片的背景噪音线
//for (int i = 0; i 《 5; i++)
//{
// int x1 = random.Next(image.Width);
// int x2 = random.Next(image.Width);
// int y1 = random.Next(image.Height);
// int y2 = random.Next(image.Height);
// g.DrawLine(new Pen(Color.BurlyWood), x1, y1, x2, y2);
//}
//System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(new Rectangle(0, 0, image.Width, image.Height), Color.FromArgb(75,36,246), Color.FromArgb(75,36,246), 1.2f, false);
//
Color fontColor ={
Color.FromArgb(206, 134, 16),
Color.FromArgb(84, 137, 3),
Color.FromArgb(0, 109, 0),
Color.FromArgb(10, 36, 106),
Color.FromArgb(64,98,35),
Color.FromArgb(56,132,83),
Color.FromArgb(0, 153, 255),
Color.FromArgb(49,70,69),
Color.FromArgb(91,120,68),
Color.FromArgb(0,0,0),
Color.FromArgb(255, 0, 0),
Color.FromArgb(99,37,15)
};
char TempChar = checkCode.ToCharArray();
for (int i = 0; i 《 TempChar.Length; i++)
{
Font font = new System.Drawing.Font( System.Drawing.FontFamily.GenericSerif, 12, FontStyle.Bold );
//System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(new Rectangle(0, 0, image.Width, image.Height), Color.Green, Color.Green, 1.5f);
Color t = fontColor[random.Next( fontColor.Length )];
System.Drawing.Drawing2D.HatchBrush brush = new System.Drawing.Drawing2D.HatchBrush( System.Drawing.Drawing2D.HatchStyle.SolidDiamond, t, t );
g.DrawString( TempChar[i].ToString(), font, brush, 2 + i * 12, random.Next( 5 ) );
}
//画图片的前景噪音点
for (int i = 0; i 《 100; i++)
{
int x = random.Next(image.Width);
int y = random.Next(image.Height);
image.SetPixel(x, y, Color.FromArgb(random.Next(255), random.Next(255), random.Next(255)));
}
//画图片的边框线
g.DrawRectangle(new Pen(Color.Black), 0, 0, image.Width - 1, image.Height - 1);
System.IO.MemoryStream ms = new System.IO.MemoryStream();
image.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
Response.ClearContent();
Response.ContentType = “image/Gif“;
Response.BinaryWrite(ms.ToArray());
}
finally
{
g.Dispose();
image.Dispose();
}
}
}
苹果商店无法连接appstore
如果你是指iPhone手机出现无法连接App Store的情况,建议你可通过以下方式排障:
1、使用手机数据上网,可以查看手机是否可正常打开其他网页或应用。
2、如使用WIFI上网,你可查看该WIFI网络是否能正常连接并访问其他网页。你可重启无线路由器,然后进入iPhone手机设置删除该WIFI,再重新加入WIFI。
3、如还无法使用,你可还原网络设置尝试,路径:“设置” –》 “通用” –》 “还原” –》 “还原网络设置”,设备便会重启。
4、如果是手机设置了访问限制,你可重置访问限制尝试,路径:“设置”–》 “通用” –》 “访问限制”,开启访问限制5秒,然后再关闭访问限制。
-http status 500