验证码死都不显示 只好来求助大家了

hahavipo 2011-12-27 11:45:45
我刚进这个公司,前一个写程序的走了,没有留下开发文档,自己熟悉了几天代码,我从服务器上面把程序把数据库复制到了本地,配置环境 都配置好了 开始的时候验证码能显示,后台登录的验证码一直不能显示,蛋疼了一个星期了,各位帮我参谋参谋。。网上说的办法我都试过了,开启了父路径,开启ADODB.Stream了组件,浏览器没问题,我估计是验证码文件的问题,因为我一直找不到random验证码文件。

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Jetway.Web.Areas.Admin.Models.AdminSignIn>" %>
<%@ Import Namespace="CaptchaExample.Helpers" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>管理员登录</title>
<link href="<%:Url.Content("~/Content/Css/Validation.css")%>" rel="stylesheet" type="text/css" />
<style type="text/css">
html,body
{
height:100%;
}
body,input
{
font-family:微软雅黑;
font-size:12px;
}
.login-table
{
background-image:url(../../Content/Images/loginbg.jpg);
background-position:center center;
width:554px;
height:518px;
}
.form-table
{
width:312px;
margin-top:88px;
margin-right:10px;
}
.form-table td
{
height:36px;
vertical-align:middle;
}
.form-table td input
{
width:120px;
}
#ValidateCode
{
width:42px;
}
.tip-td
{
text-align:left;
vertical-align:bottom;
}
</style>
<script src="<%:Url.Content("~/Scripts/jquery-1.4.1.min.js")%>" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">
$(function () {
$("#ValidateCode").focus(function () {
$("#captchaImg").attr("src", '<%:Url.Action("Render", "CaptchaImage",new{area=""})%>' + '/' + Math.random()).css({ 'display': 'inline', 'cursor': 'pointer' });
$(this).unbind("focus");
})
$("#captchaImg").click(function () {
$("#captchaImg").attr("src", '<%:Url.Action("Render", "CaptchaImage",new{area=""})%>' + '/' + Math.random());
});
});
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="height:100%;">
<tr>
<td style="height:100%;" align="center">
<table border="0" cellpadding="0" cellspacing="0" class="login-table">
<tr>
<td align="right" valign="top">
<% Html.EnableClientValidation(); %>
<%using(Html.BeginForm()){%>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="width:212px;text-align:left"><%:Html.ValidationSummary(true)%></td>
<td class="tip-td">
<table border="0" cellpadding="0" cellspacing="0" class="form-table">
<tr>
<td style="width:48px; text-align:right;">
用户名:
</td>
<td style="text-align:left; padding-left:5px;">
<%:Html.EditorFor(x => x.Administrator.Name)%>
<%:Html.ValidationMessageFor(x => x.Administrator.Name, "用户名格式有误!")%>
</td>
</tr>
<tr>
<td style="width:48px; text-align:right;">
密码:
</td>
<td style="text-align:left; padding-left:5px;">
<%:Html.EditorFor(x => x.Administrator.Password)%>
<%:Html.ValidationMessageFor(x => x.Administrator.Password, "密码格式有误!")%>
</td>
</tr>
<tr>
<td style="width:48px; text-align:right;">
验证码:
</td>
<td style="text-align:left; padding-left:5px;">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<%:Html.TextBoxFor(x => x.ValidateCode, new {maxlength=6})%>
</td>
<td>
<img id="captchaImg" alt="点击刷新" title="点击刷新" style=" display:none;"/>
</td>
<td>
 <%:Html.ValidationMessageFor(x => x.ValidateCode)%>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
<td style="text-align:left; padding-left:5px;">
<input type="submit" value="登录" style="width:48px;"/>
<input type="reset" value="重置" style="width:48px;"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%}%>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script src="<%=Url.Content("~/Scripts/MicrosoftAjax.js")%>" type="text/javascript"></script>
<script src="<%=Url.Content("~/Scripts/MicrosoftMvcAjax.js")%>" type="text/javascript"></script>
<script src="<%=Url.Content("~/Scripts/MicrosoftMvcValidation.js")%>" type="text/javascript"></script>
</body>
</html>
...全文
800 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
csdn_aspnet 2011-12-27
  • 打赏
  • 举报
回复
看看你的代码是否有问题或者你的文件路径

<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/ValitionNo.aspx" />
ValitionNo.aspx是生成验证码文件
hahavipo 2011-12-27
  • 打赏
  • 举报
回复
http://127.0.0.1/captcha-image/render/ 能显示验证码了 后台不能显示 郁闷
hahavipo 2011-12-27
  • 打赏
  • 举报
回复
http://127.0.0.1/captcha-image/render/ 能显示验证码了 后台不能显示 郁闷
hahavipo 2011-12-27
  • 打赏
  • 举报
回复
置通配符映射 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll 直接就打不开网页了 晕
孟子E章 2011-12-27
  • 打赏
  • 举报
回复
另外,错误提示说你的 Session采取的是StateServer方式的,你需要启动 ASP.NET State 服务,并配置连接,开放端口等
hahavipo 2011-12-27
  • 打赏
  • 举报
回复
我本地还真没有配置通配符映射 试试
孟子E章 2011-12-27
  • 打赏
  • 举报
回复
通配符设置方法


http://www.google.com.hk/search?q=iis%20%E9%80%9A%E9%85%8D%E7%AC%A6%E6%98%A0%E5%B0%84&oe=utf-8&rls=org.mozilla:zh-CN:official&client=firefox-a&um=1&hl=zh-CN&biw=1366&bih=585&ie=UTF-8&sa=N&tab=iw&ei=imT5Tvb9GI2WiQfohLm8AQ
hahavipo 2011-12-27
  • 打赏
  • 举报
回复
0.0005715132218908625 这个数值是生成的验证码

iis里面配置通配符映射 请教下 怎么配置
孟子E章 2011-12-27
  • 打赏
  • 举报
回复
你的iis里面配置通配符映射了吗?
你的0.0005715132218908625这个数据代表的是什么意思?
hahavipo 2011-12-27
  • 打赏
  • 举报
回复
打开net_lover说的
http://127.0.0.1/captcha-image/render/?0.0005715132218908625 显示

Server Error in '/' Application.
--------------------------------------------------------------------------------

Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80072749): Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.]
System.Web.SessionState.OutOfProcSessionStateStore.MakeRequest(StateProtocolVerb verb, String id, StateProtocolExclusive exclusiveAccess, Int32 extraFlags, Int32 timeout, Int32 lockCookie, Byte[] buf, Int32 cb, Int32 networkTimeout, SessionNDMakeRequestResults& results) +2180324
System.Web.SessionState.OutOfProcSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +221
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +807
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
hahavipo 2011-12-27
  • 打赏
  • 举报
回复
程序是从服务器上面拷贝下来的。。数据库什么都是好的 我纳闷。。。公司电脑2003的系统和win7的系统都不能显示,我家里的笔记本winxp也不能显示 就服务器上面能显示
孟子E章 2011-12-27
  • 打赏
  • 举报
回复
一般应该是这样写吧
http://127.0.0.1/captcha-image/render
带随机数应该
http://127.0.0.1/captcha-image/render/?0.0005715132218908625
孟子E章 2011-12-27
  • 打赏
  • 举报
回复
所以啊,你的程序或者配置问题,或者路由设置问题,这样就一目了然了,学会调试很重要
hahavipo 2011-12-27
  • 打赏
  • 举报
回复
郁闷 上传不了图片

打开http://127.0.0.1/captcha-image/render/0.0005715132218908625 显示:
无法找到该页
您正在搜索的页面可能已经删除、更名或暂时不可用。
--------------------------------------------------------------------------------

请尝试以下操作:

•确保浏览器的地址栏中显示的网站地址的拼写和格式正确无误。
•如果通过单击链接而到达了该网页,请与网站管理员联系,通知他们该链接的格式不正确。
•单击后退按钮尝试另一个链接。
HTTP 错误 404 - 文件或目录未找到。
Internet 信息服务 (IIS)

--------------------------------------------------------------------------------

技术信息(为技术支持人员提供)

•转到 Microsoft 产品支持服务并搜索包括“HTTP”和“404”的标题。
•打开“IIS 帮助”(可在 IIS 管理器 (inetmgr) 中访问),然后搜索标题为“网站设置”、“常规管理任务”和“关于自定义错误消息”的主题。


而服务器上面的 访问能看到验证码
孟子E章 2011-12-27
  • 打赏
  • 举报
回复
那你就在浏览器地址栏里面输入http://127.0.0.1/captcha-image/render/0.0005715132218908625看显示或者提示什么?
hahavipo 2011-12-27
  • 打赏
  • 举报
回复
http://127.0.0.1/captcha-image/render/0.0005715132218908625 属性是这个
孟子E章 2011-12-27
  • 打赏
  • 举报
回复
点击图片右键属性,查看url地址是什么
hahavipo 2011-12-27
  • 打赏
  • 举报
回复
我感觉好像没问题 因为程序在服务器上面运行啥问题都没有 验证码也能显示 我全部下载到了本地 就出现这个问题了
求助网是web2.0系统,一问多人参与,评论,分享DIGG多种模式于一体系统,更多好的功能请站长们自己体会吧! 求助网第四回发布,增加一下功能,多谢各位朋友理解和支持! *本套系统主要是增加了,静态页功能,增加了SEO,所有问题都生成静态页面 1、字母长不换行的问题 2、搜索字母BUG 3、静态页面JS浏览量,实时更新 5、匿名可以回答问题 6、发布问题具有审核功能 7、首页增加了调用奖品 8、回答的问题具有支持和反对 9、弹出窗口,关闭刷父页面 10、JS可以调用任何类别、任何数量的问题 11、发布问题和回答增加验证码功能 12、发布和回答问题有编译器功能,可以引用图片,增加效果文字 13、完善邮件系统 14、增加了版主权限 15、会员个人信息默认头像不显示问题 安装方法:将程序传到空间即可 数据库路径:whelpu_d/help.mdb,下载后,请修改数据库路径 修改数据库路径:include/conn.asp 版权说明:本套系统版权归求助网(www.whelpu.com)所有,任何人都可以使用以及修改开源版本,但是不允许复制给第三人(或者出售)、一旦发现将追究版权问题 更多功能请咨询商业版本 调测安装说明:进入后台必须要在前台先登陆,之后点进入管理中心进入后台。 用户名:求助网 密码:123123 如果在使用过程中,发现问题和疑问请和客服联系:QQ:359000335

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧