×

localhost 8080 s c

为什么输入localhost:8080不能进入下面这个页面,输入localhost:9090才能进入下面这个页面?用JS怎么实现点击按钮,能相当于网页的后退功能

admin admin 发表于2022-05-09 14:24:55 浏览157 评论0

抢沙发发表评论

为什么输入localhost:8080不能进入下面这个页面,输入localhost:9090才能进入下面这个页面

这是因为你的Tomcat的配置文件里的端口改成9090了,你改回8080后,重新启动。再以localhost:8080访问就可以了。具体方法如下:1、进入Tomcat所在文件夹,比如我的是E:\work\service\tomcat7.0.65\conf2、找到server.xml文件,打开3、找到 《Connector port=“9090“ protocol=“HTTP/1.1“ connectionTimeout=“20000“redirectPort=“8443“ /》这一段。修改port=“8080“.4、保存后重新启动Tomcat,再以localhost:8080访问就可以了。希望能帮到你!

用JS怎么实现点击按钮,能相当于网页的后退功能

直接再按钮上添加点击事件; 如返回按钮

《a href=“javascript:history.back(-1);“》返回上一页《/a》

asp验证码是用什么方法实现的

   一般正规写法如下

  1.  《td》《img id=“img1“ alt=““  src=“ValidateCode.ashx“ /》《/td》

  2. 登录按钮下面进行

     if (txtValidateCode.Text!= Session[“ValidateCode“].ToString())

           Response.Write(“验证码输入错误,请重新输入!“);

        }

3. 添加一个一般处理程序ValidateCode.ashx

    再写一个ValidateCode.ashx,里面代码如下

public class ValidateCode : IHttpHandler, IRequiresSessionState

    {

        private static char constant = { ’3’, ’4’, ’5’, ’7’, ’8’, ’9’, ’a’, ’d’, ’e’, ’f’, ’g’, ’h’, ’i’, ’j’, ’k’, ’m’, ’n’, ’p’, ’r’, ’s’, ’t’, ’u’, ’v’, ’w’, ’x’, ’y’, ’A’, ’B’, ’D’, ’E’, ’F’, ’H’, ’J’, ’K’, ’L’, ’M’, ’N’, ’P’, ’Q’, ’R’, ’S’, ’T’, ’U’, ’V’, ’W’, ’X’, ’Y’ };-c

        public void ProcessRequest(HttpContext context)

        {

            //context.Response.ContentType = “text/jpg“;

            //context.Response.Write(“Hello World“);

            Bitmap newBitmap = new Bitmap(76, 25, System.Drawing.Imaging.PixelFormat.Format32bppArgb);-s

            Graphics g = Graphics.FromImage(newBitmap);

            Random r = new Random();

            g.Clear(Color.White);

            System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(new Rectangle(0, 0, 86, 26), Color.Red, Color.Blue, 1.2f, true);-c

            for (int i = 0; i 《 25; i++)

            {

                int x1 = r.Next(newBitmap.Width);

                int x2 = r.Next(newBitmap.Width);

                int y1 = r.Next(newBitmap.Height);

                int y2 = r.Next(newBitmap.Height);

                g.DrawLine(new Pen(Color.Silver), x1, y1, x2, y2);

            }

            for (int i = 0; i 《 100; i++)

            {

                int x = r.Next(newBitmap.Width);

                int y = r.Next(newBitmap.Height);

                newBitmap.SetPixel(x, y, Color.FromArgb(r.Next()));

            }

            string value = GenerateRandom(4);

            Font font = new Font(“黑体“, 16, System.Drawing.FontStyle.Bold);

            g.DrawString(value, font, brush, 2, 2);

            g.DrawRectangle(new Pen(Color.Silver), 0, 0, 85, 25);

            //g.FillRectangle(new   SolidBrush(Color.Green),   0,   12,   80,   1);   

            System.IO.MemoryStream ms = new System.IO.MemoryStream();

            newBitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);

            context.Response.ClearContent();

            context.Response.ContentType = “image/gif“;

            context.Response.BinaryWrite(ms.ToArray());

            context.Session[“ValidateCode“] = value;

        }

        public string GenerateRandom(int Length)

        {

            System.Text.StringBuilder newRandom = new System.Text.StringBuilder(47);

            Random rd = new Random();

            for (int i = 0; i 《 Length; i++)

            {

                newRandom.Append(constant[rd.Next(47)]);

            }

            return newRandom.ToString();

        }   

        public bool IsReusable

        {

            get

            {

                return false;

            }

        }