QQ登录技术,问下为什么'rasapi32.dll': 动态链接库(DLL)初始化例程失败
Server Error in '/' Application.
Unable to load DLL 'rasapi32.dll': 动态链接库(DLL)初始化例程失败。 (Exception from HRESULT: 0x8007045A)
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.DllNotFoundException: Unable to load DLL 'rasapi32.dll': 动态链接库(DLL)初始化例程失败。 (Exception from HRESULT: 0x8007045A)
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[DllNotFoundException: Unable to load DLL 'rasapi32.dll': 动态链接库(DLL)初始化例程失败。 (Exception from HRESULT: 0x8007045A)]
System.Net.RasHelper.RasEnumConnections(RASCONN[] lprasconn, UInt32& lpcb, UInt32& lpcConnections) +0
System.Net.RasHelper.GetCurrentConnectoid() +136
System.Net.AutoDetector.Initialize() +132
System.Net.AutoDetector.get_CurrentAutoDetector() +20
System.Net.AutoWebProxyScriptEngine..ctor(WebProxy proxy, Boolean useRegistry) +54
System.Net.WebProxy.UnsafeUpdateFromRegistry() +33
System.Net.WebProxy..ctor(Boolean enableAutoproxy) +7
System.Net.Configuration.DefaultProxySectionInternal..ctor(DefaultProxySection section) +478
System.Net.Configuration.DefaultProxySectionInternal.GetSection() +113
[ConfigurationErrorsException: Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section.]
System.Net.Configuration.DefaultProxySectionInternal.GetSection() +208
System.Net.WebRequest.get_InternalDefaultWebProxy() +133
System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint) +173
System.Net.HttpRequestCreator.Create(Uri Uri) +26
System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase) +225
System.Net.WebRequest.Create(String requestUriString) +44
YanNanFei.QQOAuth.RequestUrl(String url) in H:\个人项目\雁南飞\YanNanFei_0723\YanNanFei\App_Code\QQOAuth.cs:117
YanNanFei.QQOAuth.GetTempToken() in H:\个人项目\雁南飞\YanNanFei_0723\YanNanFei\App_Code\QQOAuth.cs:44
YanNanFei.Oauth.QQlogin.Page_Load(Object sender, EventArgs e) in H:\个人项目\雁南飞\YanNanFei_0723\YanNanFei\Oauth\QQlogin.aspx.cs:14
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8387
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253
System.Web.UI.Page.ProcessRequest() +78
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.oauth_qqlogin_aspx.ProcessRequest(HttpContext context) in c:\windows\microsoft.net\Framework\v4.0.30319\Temporary ASP.NET Files\root\dd65a775\9890d957\App_Web_j1c3mqam.1.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
我点击登录按钮时候连接到/oauth/QQlogin.aspx这样一个页面,这个页面里面代码是
string QQreturnstr = QQOAuth.GetTempToken();
if (QQreturnstr.IndexOf("error_code") < 0)
{
//获得临时令牌成功
string[] temps = QQreturnstr.Split('&', '=');
Session["oauth_token_secret"] = temps[3];
//下面引导用户登录,将用户引导到QQ登录界面
Response.Redirect("http://openapi.qzone.qq.com/oauth/qzoneoauth_authorize?oauth_consumer_key=" + QQOAuth.appid + "&oauth_token=" + temps[1] + "&oauth_callback=http://webtest.viecn.com/Oauth/GetRightQQTonken.aspx");
}
但是现在的问题是,点击登录按钮连接这个页面就直接报错!
[解决办法]
应用程序池-标识-选本地系统或者输入管理员身份的账户