文章导航PC6首页软件下载单机游戏安卓资源苹果资源

pc软件新闻网络操作系统办公工具编程服务器软件评测

安卓新闻资讯应用教程刷机教程安卓游戏攻略tv资讯深度阅读综合安卓评测

苹果ios资讯苹果手机越狱备份教程美化教程ios软件教程mac教程

单机游戏角色扮演即时战略动作射击棋牌游戏体育竞技模拟经营其它游戏游戏工具

网游cf活动dnf活动lol周免英雄lol礼包

手游最新动态手游评测手游活动新游预告手游问答

您的位置:首页技术开发ASP教程 → NET移植案例学习:建造Web站点6

NET移植案例学习:建造Web站点6

时间:2004/11/7 4:14:00来源:本站整理作者:蓝点我要评论(0)

图3 Config.web文件



<?xml version="1.0" encoding="utf-8" ?>

<configuration>



 <!-- SECURITY

  This section sets the security policies of the application.

  Possible modes are "Windows", "Cookie",

  "Passport" and "None"

 -->



 <!-- Use Cookie Authentication for external users -->





 <security>

  <authentication mode="Cookie">

   <cookie cookie=".PRODAUTH" loginurl="https://

     beta.visualstudio.net/Login.aspx"

    decryptionkey="autogenerate">



    <credentials passwordformat="Clear" />

   </cookie>

  </authentication>

  <authorization>

   <allow users="*" />

  </authorization>

 </security>

</configuration>





  图4 认证代码



Public Sub cmdSubmit_Click(ByVal sender As Object, ByVal e As _

System.EventArgs)

 Dim sUserID As String

 Dim sPassword As String

 Dim sAuthCookie As String



 'External user, take the values from the Login form

 sUserid = system.Convert.ToString(Me.txtUserID.Value)

 sPassword = system.Convert.ToString(Me.txtPassword.Value)



 adoRS = oBetaUser.LoginEx(sUserID, sPassword)



 If adoRS.recordcount = 1 Then

  'login success - get a session

  adoRS = osSession.GetNewSession _

    (adoRS("BetaSiteID").Value.ToString().ToInt32())



  If Not adoRS Is Nothing Then

   If adoRS.Recordcount > 0 Then

    adoRS.movefirst()



    'Set the authentication cookie using the SID

    sAuthCookie = adoRS("SID").Value.ToString()



    'use ASP+ authentication to authenticate the user,

    If Instr(CookieAuthentication.GetRedirectUrl _

       (sAuthCookie, True), "default.aspx") > 0 Then

     CookieAuthentication.SetAuthCookie(sAuthCookie, True)

     Response.Redirect(system.Convert.ToString( _

              oSiteUser.GlobalPath) & "Home.aspx")

    Else

     CookieAuthentication.RedirectFromLoginPage( _

                   sAuthCookie, True)

    End If

   Else

    'login failed

    Response.Redirect("LoginFailed.aspx")

   End If

  Else

   'login failed

   Response.Redirect("LoginFailed.aspx")

  End If

 Else

  'login failed

  Response.Redirect("LoginFailed.aspx")

 End If

End Sub




相关阅读 Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么

文章评论
发表评论

热门文章 没有查询到任何记录。

最新文章 《龙珠:超宇宙》 战斗E3 2014:瘆人僵尸《消 asp代码实现access数据导出到excel文件如何使用FSO读取Js文件内容并可以编辑修改对初学者有用的一些asp函数集学习ASP编程必会的代码

人气排行 asp代码实现access数据导出到excel文件asp不需要任何配置的伪静态实现如何使用FSO读取Js文件内容并可以编辑修改asp去除html标记和空格的代码Asp全选删除代码教大家网页伪静态知识及其2种实现方法Microsoft SQL Server 7.0安装问题(一)ASP.NET中的Code Behind技术4