精华内容
下载资源
问答
  • CTF Forms

    千次阅读 多人点赞 2020-09-25 11:10:39
    似乎有人觉得PIN码是不可破解的,让我们证明他是错的。 格式:ctf{} 解题链接: ... 2、接着查看源码(F12或 Fn+F12) 3、把"value=0"改为"value=1"—>回车,然后在输入框输入0—>...5、找到ctf{forms_are_easy}—&g

    似乎有人觉得PIN码是不可破解的,让我们证明他是错的。 格式:ctf{}

    解题链接:http://ctftime2.nisphome.cn/10/main.php

    1、点击链接之后,跳到以下页面
    在这里插入图片描述
    2、接着查看源码(F12或 Fn+F12)
    在这里插入图片描述
    3、把"value=0"改为"value=1"—>回车,然后在输入框输入0—>Enter,然后出现以下画面
    在这里插入图片描述
    4、接着把" -19827747736161128312837161661727773716166727272616149001823847"输入进输入框—>回车

    在这里插入图片描述
    5、找到ctf{forms_are_easy}—>输入—>提交KEY

    在这里插入图片描述

    6、OK
    在这里插入图片描述

    展开全文
  • Xamarin Forms中文文档

    2018-11-12 16:22:29
    Xamarin Forms中文文档 Xamarin Forms中文文档 Xamarin Forms中文文档
  • forms.Form和forms.ModelForm

    2019-07-05 18:35:48
    forms.ModelForm是forms.Form的升级版 forms.Form验证规则 2.1 forms.py 2.2 view.py 把我们写的UserResetForm导入到view.py 2.3 模板 forms.ModelForm验证规则 3.1 models.py 3.2 forms.py就用上面模型类...
    1. forms.ModelForm是forms.Form的升级版

    2. forms.Form验证规则
      2.1 forms.py

      在这里插入图片描述
      在这里插入图片描述
      2.2 view.py 把我们写的UserResetForm导入到view.py 在这里插入图片描述
      2.3 模板
      在这里插入图片描述

    3. forms.ModelForm验证规则
      3.1 models.py
      在这里插入图片描述
      3.2 forms.py就用上面模型类里面的验证规则
      在这里插入图片描述
      3.3 view.py
      在这里插入图片描述
      3.4 模板看你实际的情况

    4. forms.ModelForm远不止你看的这些功能, forms.ModelForm还能自定义匹配规则, 列手机号
      在这里插入图片描述
      记住自定义匹配规则方法都必须以clean_开头

    5. is_valid()验证规则

       (1)首先is_valid()起手,看seld.errors中是否值,只要有值就是flase
       (2)接着分析errors.里面判断_errors是都为空,如果为空返回self.full_clean(),否则返回self._errors
       (3)现在就要看full_clean(),是何方神圣了,里面设置_errors和cleaned_data这两个字典,一个存错误字段,一个存储正确字段。
       (4)在full_clean最后有一句self._clean_fields(),表示校验字段
       (5)在_clean_fields函数中开始循环校验每个字段,真正校验字段的是field.clean(value),怎么校验的不管
       (6)在_clean_fields中可以看到,会将字段分别添加到_errors和cleaned_data这两个字典中
       (7)结尾部分还设置了钩子,找clean_XX形式的,有就执行。执行错误信息也会添加到_errors中
       (8)整个校验过程完成 
      
    6. is_valid()在验证数据时判断多个字段不能同时相同

       列子:
       有6个input框, 下面的1, 2, 3, 4, 5, 6依次在这6个框中
       
       意思就是当你第一次提交的数据是1,2,3,4,5,6
       你第二次不能提交1,2,3,4,5,6这样会报错,因为
       你这次提交的数据跟上次提交的数据相同,你要是提
       交7,8,1,2,3,4都会提交上去,因为你有部分数据不
       同.
      
    展开全文
  • WindowsFormsApplication1

    2018-04-04 19:18:08
    WindowsFormsApplication1.rar WindowsFormsApplication1.rar WindowsFormsApplication1.rar
  • I wrote this document because so many people in the Oracle Technology Network (OTN) Forms Forum have asked “How do I run a form from the Forms Builder?” or “I just installed Forms 10g

    Introduction
    I wrote this document because so many people in the Oracle Technology Network (OTN) Forms Forum have asked “How do I run a form from the Forms Builder?” or “I just installed Forms 10g and all I get is a blank browser window when I run a form.” After I responded to numerous posts (always writing the instructions from scratch) I decided to write this document. As they say, “It is always better to reuse then to recreate!”

    Disclaimer

    First and foremost, this document targets the following Oracle Developer Suite (Forms/Reports) versions:  10g R1 (9.0.4.x.x) and 10g R2 (10.1.2.x.x). 
    Many of the concepts apply to the Oracle Fusion Middleware (FMw) 11g suite (Forms and Reports), but this document is not intended to help you with FMw configuration. 
     
    The information in this document could be adapted to Oracle Forms 9i, but I do not currently have access to this version of Forms so there is no guarantee that these methods will work for Forms 9i.
     
    Secondly, this document is NOT all inclusive – meaning it is not a full reference to all setup options available.  This document is meant only to get you up and running.  If you need to use features that are not listed in this document, please refer to the appropriate Oracle document available at the Oracle Technology Network (OTN).
     
    Lastly, this article assumes you have successfully installed the Oracle Developer Suite (ODS) 10g R2 (10.1.2.x.x).  If you have not already installed the ODS then you will need to do this before you can proceed.

    Background

    If you have used Oracle Forms long enough, you will remember the day when you could run a Form locally from the Forms Builder with the Forms Runtime.  This was a very nice feature that enabled you to perform incremental development and testing; the Forms Debugger utility; not to mention the Forms Runtime Diagnostics (FRD).  With the advent of Forms 9i – when Oracle made Forms web deployed only – many developers thought the ability to run a form from the Forms Builder was lost.  This is not true; it is just a little harder to do now and requires some configuration setup on your workstation to make it work.  Forms 10g use the OC4J Forms Servlet to emulate a Forms Service web process on your workstation that allows you to “serve” a web form from the Forms Builder.  This is a very generic description of what OC4J is and what it does, but it will suffice for the purpose of this document.  In order to run a form from the Forms Builder, Oracle has included two new program items (among others) in Oracle Developer Suite Program group of the installed Oracle Developer Suite 10g.  These two program items are the “Start OC4J Instance” and “Stop OC4J Instance.”  Both are critical to the running of forms from the Forms Builder. 

    Let’s get started…

    There are two parts to configuring Forms Builder to run forms.  The first relates to Forms Builder and the second relates to the OC4J Forms Servlet.  Most forms developers will be familiar with configuring the Forms Builder as this involves setting up key environment/registry variables so the Forms Builder can find libraries (PL/SQL libraries [.pll] and Forms Object Libraries [.olb]).  However, fewer developers are familiar with setting up the OC4J environment variables which enable you to run a form from the Forms Builder.
     
    There are two Java Runtimes (JREs) supported by Forms Builder;  Oracle Jinitiator and the Oracle (Sun) Java Runtime Environment (Sun JRE).  By default, Forms Builder is configured to use the Oracle Jinitiator and in most cases this should be sufficient for your needs.  Configuration is simply to install the Oracle Jinitiator (make sure you install the right version because each Forms version defaults to different version.  For example, Oracle Forms 10g R2 (10.1.2.0.2) defaults to using Oracle Jinitiator 1.3.1.22.  If you install the version found in your Oracle DevSuite home directory (\%DEV_SUITE_HOME%\jinit) you should be OK.  If you decide to use the Sun JRE, again, you will need to install the appropriate version as the Forms Builder ships configured to a specific version of the Sun JRE.  For example, Oracle Forms 10g R2 (10.1.2.0.2) defaults to Sun JRE version 1.4.2 update 6 (1.4.2_06).  Most likely, you will have to update the default settings as you likely do have the Sun JRE installer for 1.4.2 and it is no longer available for download.  Therefore, you will likely be installing the latest version of the Sun JRE which is Java 6 (1.6.0). 
     
    Which JRE you use is also dependent on your Operating System (OS) version and your Internet Browser version.  This document focuses on setup for the Microsoft Windows Operating System and Internet Explorer and Mozilla Firefox browsers.  The following is the Oracle certified supported configurations.
     
     OS  Java Runtime
     Windows  Jinitiator  Sun JRE
     Internet Explorer      

     version 5

     1.3.1.x+   1.4.1+

     version 6

     1.3.1.22+  1.4.2_06+

     version 7

     1.3.1.28  1.5.0_06+

     version 8

     1.6.0_16+  1.6.0_16+
     FireFox 3.5+  NS  1.6.0_16+
    + = indicates a higher version can be used
    NS = Not Supported
     
    This list is an abbreviated list.  For a complete list – review the appropriate Oracle Certification Matrix document on OTN.
     
    Alright, enough background.  It’s time to get the heart of this document. 
     
    This document will be focused into three sections:  Forms Builder config, OC4J with Jinitiator, and OC4J with Sun JRE.
     

    Forms Builder Configuration

    Forms Builder is dependent on the following variables (there are others, but these are the most important):
    • FORMS_PATH
    • FORMS_BUILDER_CLASSPATH
    • TNS_ADMIN
    FORMS_PATH is used by Forms Builder to record the location of attached libraries (.pll) and subclassed objects (such as items from a Template.fmb or Object Library [.olb]).  You can also include your Forms working directory in this variable and Forms runtime will be able to find your compiled Forms binaries when you run a form from the Forms Builder.  This saves you having to modify the “formsweb.cfg” file to include a configuration for each form you develop (I’ll include a brief discussion of custom configurations at the end of this document).
     
    This variable is mandatory if you use attached libraries or subclassed objects.
     
    FORMS_BUILDER_CLASSPATH is used by Forms Builder to record the location of any Java Pluggable Components or Java Beans that are implemented in a form. 
     
    This variable is optional, but you will receive a Forms Builder error during design time indicating that Forms Builder can’t find the implemented Java source.  This is a design time error only and does not affect runtime.
     
    TNS_ADMIN is used by Forms Builder to find your TNSNAMES.ora and SQLNET.ora files.  This variable is handy if you have multiple Oracle Homes installed because it allows you to share a single set of TNS configuration files.
     
    This variable is optional, but if you have multiple Oracle homes you will have to maintain separate copies of the TNS files for each Oracle home.
     
    These variables can be set in either the Windows Registry (Windows XP) through the Windows System Environment Variables.  This document will describe both methods of setting these variables.
     

    Windows Registry

    1. Open the Windows Registry Editor (regedit.exe or reged32.exe)
    2. Navigate to the appropriate Oracle Home
    • HKEY_LOCAL_MACHINE
    • SOFTWARE
    • Oracle
    • HEY_DevSuiteHome10g
    3. FORMS_PATH: In the Key listing, scroll through and find the FORMS_PATH string variable and double-click or right-click and select “Modify” to edit the variable.
    a. DO NOT delete the existing value.  Add directory information by separating it with semicolons “;”. 
    b. Example:
            FORMS_PATH=C:\DevSuiteHome10g\cgenf61\admin;C:\Forms_Dev\*;
     
            Note: I have found that I can include a wildcard reference in the FORMS_PATH.  This allows me organize all of my Forms development into a 
            single directory.  In my Forms_Dev directory, I have a Forms_Lib directory where I store all of my referenced items such as; attached libraries (.pll), 
            object libraries (.olb) and object referenced from a Forms Template file (template.fmb).  Additionally, if I am working on different projects, I can 
            create a subdirectory for each project.
     
    4. FORMS_BUILDER_CLASSPATH:  find the existing entry for this key and open the key editor. 
    a. Again – DO NOT delete any existing values
    b. Add to the exiting directory and .jar file listing by separating each entry with a semicolon.
    5. TNS_ADMIN:  This entry does not exist, you will have to create this entry in each of the Oracle Homes. 
    a. In the key listing, right-click somewhere and New => String Value from the context menu
    b. This will create an empty string entry.
    c. Open the editor for the string and enter the full path to your TNS configuration files.  Eg: C:\DevSuiteHome10g\NETWORK\Admin
     

    Windows Environment Variables

    1. Open the System Properties control panel applet. (Start Menu => Control Panel => System)
    2. Click on the Advanced tab.
    3. Click on the Environment Variables button towards the bottom.
    4. If more than one person uses the workstation, I recommend you add the FORMS_PATH variable to the set of User Variables rather than add it to the list of System Variables.  This allows each user to set their own preferences.
    a. Click on the New button and enter the Variable Name and Variable Value
    i. Variable Name = FORMS_PATH
    ii. Variable Value = full path to your working and library directories
    iii. You do not have to worry about the default value of this variable in the registry as this environment variable augments the registry.
    5. Do the same thing for the FORMS_BUILDER_CLASSPATH and TNS_ADMIN variables.
     
    This completes the Forms Builder setup.

    OC4J Servlet setup

    The OC4J Servlet setup is a bit more complex in that all of the variables are stored one of two files.  These files are:
    • DEFAULT.ENV
    • FORMSWEB.CFG
    These file can be found in the \%DEV_SUITE_HOME%\forms\server directory.  I strongly recommend you make a back up copy of the original file before you modify these files.
     
    Note:  These files should only be modified on the application server using the Oracle Enterprise Manager (OEM).  The Developer Suite installation does not include the OEM so modifications must be made manually with a text editor.

    DEFAULT.env

    – This file is used to set Forms runtime environment parameters.  There are only two parameters that I have had to modify to enable running a form from the Forms Builder. They are:  FORMS_PATH and CLASSPATH.

    The FORMS_PATH needs to have the same directories listed as stated above for the equivalent Registry or Environment variable.
    The CLASSPATH only need to be modified if you implement a PJC or Java Bean in your form.   You will need to list the full path, to include the file name, in this parameter listing.  This parameter has a maximum character length of 256 characters.
     

    FORMSWEB.cfg

    – This file contains the parameter values used by the Forms Servlet.  There are two types of parameters: SYSTEM and USER defined.  System parameters are static in that they can not be overridden at run time.  User parameters have an entry in the baseHTML file and can be overridden in the URL query string. 
     
    This file is where the bulk of changes are needed the enable running a form from the Forms Builder.  I will not list all of the parameters as there are too many.  Refer to the Application Server Forms Services Deployment Guide (see references) for a complete listing of all parameters and more detailed information.
     
    Configuration will be separated by Java Runtime used.  I’ll list Sun JRE first and Jinitiator second.  Bear in mind, that Oracle has retired the Jinitiator and no longer supports its use. 
     
    The formsweb.cfg is broke up into separate defined configurations.  Each configuration is named and can be identified by the name in square brackets.  For example, the ‘Default” configuration is listed as: [default].  This is the configuration that is used unless it is overridden through the URL query string. 
     
    I’ll list later in the document how you can override a User parameter or specify a custom configuration later in the document.
     
    Conventions used:
    Settings listed in Green are code comments
    Settings listed in Blue are original settings
    Settings listed in Red are recommend changes
    Settings listed in Purple are optional changes
     
    Sun JRE
    Modify the following settings to use a JRE version different from the default if 1.4.2.  The following JRE changes instruct the Forms Runtime to use the JRE version 1.6.0 update 22 (1.6.0_22).  The following settings are all found in the [default] configuration section.

    # System parameter: base HTML file for use with JInitiator client

    # baseHTMLjinitiator=basejini.htm

    baseHTMLjinitiator=basejpi.htm

    Oracle Forms is hardwired (so to speak) to use the Oracle Jinitiator. Therefore, to instruct the Forms Runtime to use the JRE without passing a URL query string parameter, it is recommended you change the “baseHTMLinitiator” parameter to point to the Java Plug-In (JPI) html file. You could also expand the existing [jpi] section and instruct the Forms runtime to use this configuration in the URL. Personally, I find this to be the easier solution.

     

    # Page displayed to users to allow them to download Sun's Java Plugin.

    # Sun's Java Plugin is typically used for non-Windows clients.

    # (NOTE: you should check this page and possibly change the settings)

     

    # Original setting

    #jpi_download_page=http://java.sun.com/products/archive/j2se/1.4.2_06/index.html

    # New – points to the generic ( non-version specific) JRE download web site

    jpi_download_page=http://www.oracle.com/technetwork/java/javase/downloads/index.html

     

    # Parameter related to the version of the Java Plugin

    # Original setting

    #jpi_classid=clsid:CAFEEFAC-0014-0002-0006-ABCDEFFEDCBA

    # This setting is specific to JRE 1.6.0_22

    jpi_classid=clsid:CAFEEFAC-0016-0000-0022-ABCDEFFEDCBA

    # Optional – Generic to any version of JRE 1.6.0.   Note the difference between these two settings.

    jpi_classid=clsid:CAFEEFAC-0016-0000-FFFF-ABCDEFFEDCBA

     

    # Parameter related to the version of the Java Plugin

    # Original setting

    #jpi_codebase=http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,06

    # New – specific to JRE 1.6.0_22

    jpi_codebase=http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab#Version=1,6,0,22

    # Optional – Generic to JRE 1.6.0

    jpi_codebase=http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab#Version=1,6,0

     

    # Parameter related to the version of the Java Plugin

    # Original Setting

    #jpi_mimetype=application/x-java-applet;jpi-version=1.4.2_06

    # New – specific to JRE 1.6.0_22

    jpi_mimetype=application/x-java-applet;jpi-version=1.6.0_22

    # Optional – Generic to JRE 1.6.0

    jpi_mimetype=application/x-java-applet;jpi-version=1.6.0

     

    Oracle Jinitiator
    Modify the following settings to use a Jinitiator version different from the default if 1.3.1.26.  There  are no optional settings for Jinitiator.

    # Page displayed to Netscape users to allow them to download Oracle JInitiator.

    # Oracle JInitiator is used with Windows clients.

     

    # If you create your own page, you should set this parameter to point to it.

    # jinit_download_page=/forms/jinitiator/us/jinit_download.htm

    # Parameter related to the version of JInitiator

    jinit_classid=clsid:CAFECAFE-0013-0001-0026-ABCDEFABCDEF

    jinit_classid=clsid:CAFECAFE-0013-0001-0028-ABCDEFABCDEF

    # Parameter related to the version of JInitiator

    # jinit_exename=jinit.exe#Version=1,3,1,26

    jinit_exename=jinit.exe#Version=1,3,1,28

    # Parameter related to the version of JInitiator

    # jinit_mimetype=application/x-jinit-applet;version=1.3.1.26

    jinit_mimetype=application/x-jinit-applet;version=1.3.1.28

     

    Default URL Query String and parameters

     

    The default URL query string used by the Forms Builder is:

    http://myhost.mydomain.com/forms/frmservlet?

     

    With reference to the aforementioned JPI change for the “baseHTMLjinitiator=” parameter, alternatively, you could pass the JPI configuration in the URL query string.  To do this, simply add “config=jpi” to the default URL query string.  Passing this additional parameter, the default URL would look like:

    http://myhost.mydomain.com/forms/frmservlet?config=jpi

     

    However, I prefer to make the change in the formsweb.cfg file as this is a more permanent change.

     

    Custom Configurations

    If you have installed the Oracle Demo’s you will find that Oracle modifies the formsweb.cfg to add a configuration for each form included in the demo.  While this works fine for demo’s, it is a real pain in everyday development to add a configuration section for each form you work on (which is why I edit all of my forms in a directory that is in my FORMS_PATH).  However, there are times when it is good to create a configuration for a specific form.  For example, if I want to run a form with the Forms Runtime Diagnostics (FRD) enabled, I have created a configuration that enables this.  Then I simply add the parameter to the url to enable FRD (?config=my_frd).

    To create a custom configuration, open the formsweb.cfg file and scroll to the bottom of the file.  Always add additionally configurations to the end of the file.  Custom configurations will use all of the variables in the [default] section and then override any you specify in your custom configuration.  The following is based on my reference to use Forms Runtime Diagnostics (FRD).  The configuration listed below also uses a configuration specific environment file (default.env) as well.

    [my_frd]
    otherparams=record=collect log=my_frd.txt
    envFile=my_frd.env
    form=<YOUR_FORM_NAME_HERE.fmb>
    To create a specific environment file, I simply copied the default.env to my_frd.env and added the following variable:
     
    FORMS_TRACE_DIR=C:\DevSuiteHome10g\NETWORK\log
     

    References:

    - Oracle® Application Server Forms Services Deployment Guide – 10g Release 2(10.1.2) (B14032-03 – Feb 2006)
    - Oracle® Application Server Certification Information - 10 g Release 2 (10.1.2)  (B25703-62 - April 30, 2010)
    - Using the Java Plug-in (JRE/JPI) with Oracle Forms (ID 794710.1)
    - How Do the Jinitiator and JPI Parameters Work In a Forms Configuration (ID 444105.1)
     


    source:https://sites.google.com/site/craigsoraclestuff/oracle-forms---how-to-s/forms-how-to-configure-forms-builder-to-run-forms-locally


    展开全文
  • JGoodies Forms

    2011-10-18 12:25:50
    JGoodies ::Java User Interface Design-->Libraries--> JGoodies Forms
  • 本书详细描述Windows Forms命名空间中的大多数类,重点讲解System.Windows.Forms命名空间,对Windows Forms进行了系统的介绍。 本书以一个相册应用程序为主线,不断融入新的Windows Forms特性,使它从一个简单的...
  • Microsoft Forms 2.0

    热门讨论 2015-05-30 16:34:44
    使用了Microsoft Forms 2.0控件,在用户未安装FOFFICE的情况下不能使用的问题,安装此模块后,彻底解决问题!我自己亲身经历问题
  •  这两天在研究 Forms 进行用户验证, 它本身没有什么上msdn上查一下就知道怎么个搞法了! 不过我在测试的时候发现也会产生 了一些疑问!  <br />  1. 什么我在web.config 的 authentication节点下的 ...

    IT168技术文档】

      这两天在研究 Forms 进行用户验证, 它本身没有什么上msdn上查一下就知道怎么个搞法了! 不过我在测试的时候发现也会产生
    了一些疑问! 

      1. 什么我在web.config 的 authentication节点下的 Forms 中设置了Domain,当我FormsAuthentication.SetAuthCookie(loginName, false);
      之后, 然后 HttpContext.Current.User.Identity.Name 的时候总是返回给我 "", 这个让我很郁闷!
      2. 即然在 config 指定了不行,那我就在代码中指定用户cookie 的 Domain, 但是问题又出现了.
      a). 还是无法取到 Identity.Name 的值.
      b). 用户成功退出.

      如果我们对于 Cookie 的 Domain 不处理的语,也就没有我上面所说的问题.
      常规做法:
      1, 配置 web.config 节点

      
    <!--
    
    通过 <authentication> 节可以配置 ASP.NET 使用的
    安全身份验证模式,
    以标识传入的用户。
    -->
    < authentication mode ="Forms" >
    < forms name =".Bk5173"
    protection
    ="All"
    timeout
    ="30"
    path
    ="/"
    requireSSL
    ="false"
    cookieless
    ="UseDeviceProfile"
    enableCrossAppRedirects
    ="false" >
    </ forms >
    </ authentication >

      2. 验证用户的用户名和密码合法之后:

    //
    设置用户的 cookie 的值
    
    FormsAuthentication.SetAuthCookie(loginName, false );

      3 . 上一步就是把用户的名称写 cookie, 之后的话就可以 获取用户的名称.
      string idenName = HttpContext.Current.User.Identity.Name;

      4. 我们就可以根据 idenName 来对用户判断了. 如果 idenName = "" 的话那么就跳转到 登陆页面让用户登陆,否则的话就显示出用户的名称到 UI 当中.

      5. 退出时,用下面的方法就可以了.
      FormsAuthentication.SignOut();


      到这里,不知有没有注意,都没有对于Cookie Domain 进行设置, 这也正是我将要做的.修改以上的方法.
      1).修改方法:

    //
    设置用户的 cookie 的值
    
    FormsAuthentication.SetAuthCookie(loginName, false );

      为以下方法:

    //
    设置用户的 cookie 的值
    
    FormsAuthentication.SetAuthCookie(loginName, false );
    // 获取用户的 cookie
    HttpCookie cookie = FormsAuthentication.GetAuthCookie(loginName, false );
    // 给用户的 cookie 的值加上 cookie 的域 和 过期日期
    // 更新 用户 cookie
    FormsAuthenticationTicket oldTicket = FormsAuthentication.Decrypt(cookie.Value);
    FormsAuthenticationTicket newTicket
    = new FormsAuthenticationTicket( 1 ,
    oldTicket.Name,
    oldTicket.IssueDate,
    DateTime.Now.AddMinutes(
    30 ),
    oldTicket.IsPersistent,
    oldTicket.UserData,
    FormsAuthentication.FormsCookiePath);
    cookie.Domain
    = cookieDomain;
    cookie.Value
    = FormsAuthentication.Encrypt(newTicket);
    // 更新 cookie
    HttpContext.Current.Response.SetCookie(cookie);

      2). 修改用户退出时的方法

    HttpCookie cookie 
    =
     HttpContext.Current.Response.Cookies[FormsAuthentication.FormsCookieName];
    cookie.Domain
    = cookieDomain;
    cookie.Value
    = null ;
    cookie.Expires
    = DateTime.Now.AddDays( - 1 );
    // 更新cookie
    HttpContext.Current.Response.Cookies.SetCookie(cookie);
    FormsAuthentication.SignOut();

      但是如果按照以上的做法的是无法获取到 Identity.Name 的. 经过分析和查找了相关的资料后将以上方法修改成
    1).

    //
    设置用户的 cookie 的值
    
    FormsAuthentication.SetAuthCookie(loginName, false );
    // 获取用户的 cookie
    HttpCookie cookie = FormsAuthentication.GetAuthCookie(loginName, false );
    // 给用户的 cookie 的值加上 cookie 的域 和 过期日期
    // 向客户端重写同名的 用户 cookie
    FormsAuthenticationTicket oldTicket = FormsAuthentication.Decrypt(cookie.Value);
    FormsAuthenticationTicket newTicket
    = new FormsAuthenticationTicket( 1 ,
    oldTicket.Name,
    oldTicket.IssueDate,
    DateTime.Now.AddMinutes(
    30 ),
    oldTicket.IsPersistent,
    oldTicket.UserData,
    FormsAuthentication.FormsCookiePath);
    cookie.Domain
    = cookieDomain;
    cookie.Value
    = FormsAuthentication.Encrypt(newTicket);
    HttpContext.Current.Response.Cookies.Add(cookie);
    2 ).
    HttpCookie cookie
    = HttpContext.Current.Response.Cookies[FormsAuthentication.FormsCookieName];
    cookie.Domain
    = cookieDomain;
    cookie.Value
    = null ;
    cookie.Expires
    = DateTime.Now.AddDays( - 1 );
    HttpContext.Current.Response.Cookies.Add(cookie);
    FormsAuthentication.SignOut();

      这样的话用户就可以成功登陆和退出了!
      可能的原因我估计是cookie 有服务器和客户端之分.所以才会从新生成一个验证票据让之前同名的失效.

    展开全文
  • xamarin.forms, xamarin.forms,xamarin.forms,xamarin.forms,xamarin.forms,xamarin.formsxamarin.forms, xamarin.forms, xamarin.forms,xamarin.forms,xamarin.forms,xamarin.forms,xamarin.formsxamarin.forms
  • FormsAuthentication 权限验证
  • django forms表单

    2019-08-28 11:28:54
    forms表单介绍 FORMS介绍 在许多应用场景下都需要对用户的输入做校验,比如校验用户是否输入,输入的长度和格式等正不正确。如果用户输入的内容有错误就需要在页面上相应的位置显示对应的错误信息.。 form组件的...
  • Smart Forms

    2013-08-22 16:38:37
    Smart Forms Procedure 1) Define a structure and a type (We canalso don’t create it and define in the smart forms global table Pass data tothe smart forms) 2) Retrieving the application data 3) ...
  • <div><p>I recently attempted to enable compiled bindings in my Xamarin.Forms app, but I'm hitting a crash. If enable it on a read-only list, it works fine. However, if I enable it on a list where ...
  • Forms FAQ

    2012-05-28 10:35:10
    原文:http://www.orafaq.com/wiki/Forms_FAQ#What_is_Oracle_Forms_and_what_is_it_used_for.3F What is Oracle Forms and what is it used for? Oracle Forms is a 4GL Rapid Application Development (RAD) ...
  • XamarinForm教程构建XamarinForms开发环境
  • Django的forms验证

    千次阅读 2019-04-07 14:09:01
    forms验证的用途 - 用户提交的信息认证 - 错误信息反馈 - 保留上一次提交的数据 自定义表单 from django import forms as Dforms from django.forms import fields from django.forms import widgets class ...
  • django forms数据校验

    2019-04-10 17:40:34
    forms.py实现了对数据的校验 通常的实现方法是在forms.py中实现对字段的校验,然后在views.py中加载forms中的方法进行校验,demo如下: forms.py from django import forms class nameform(forms.Form): ...
  • Life Forms

    2014-01-16 15:24:39
    You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, ears, eyebrows and the like. A few bear ...
  • Microsoft.ReportViewer.WebForms 8.0.50727.762版本 使用与报表开发
  • Oracle Forms Versions

    千次阅读 2012-12-26 11:03:07
    IAF 2CharacterNo IDEFastForms+IAG 4Character SQL*Forms25Character SQL*Forms2.35CharacterNew IDE, No PLSQL, User Exits, INP ASCII File, FRM Runtime FileSQL*Forms36CharacterMajor Rewrite, New IDE, ...
  • A step by step tutorial for Oracle Forms 10g development. This guide is helpful for freshers in Oracle forms 10g. To download this ebook click the below button: Download Oracle Forms 10g eBookSee Also...
  • <div><p>I updated my Xamarin Forms project from Xamarin Forms 4.3.0.991250 to 4.4.0.991265 and now get the following NullReferenceException when I start my Android project. iOS works. at ...
  • Windows Forms 2.0 程序设计 (Windows Forms 2.0 Programming) pdf
  • 一、 前言 这十来天对Xamarin的学习踩了很多的坑,说来也是一把心酸泪,下面为大家一 一道来,并提供这些天...1、 Xamarin.forms环境搭建 2、 启动页(含图片加载) 3、 页面跳转 4、 Grid布局 5、 圆状头像 ...
  • Django中的 forms 模块

    2019-10-17 09:16:10
    1、Django中的 forms 模块 1、forms 模块的作用 通过 forms 模块,允许将表单控件与python文件相结合 2、使用 forms 模块 ①创建 forms.py 文件 ②导入 forms 模块 ③创建class,一个class对应一个表单,所有...
  • C# WindowsForms

    2018-08-21 10:24:20
    2013-11-14 16:02:58 使用MDI父窗口 的时候 把父窗口 设置最大化 子窗口也最大化 打开子窗口的时候出现问题 虽然子窗口的标题栏最大化但是...this.WindowState = System.Windows.Forms.FormWindowState.Maximized...
  • FORMS验证

    2012-10-16 09:16:14
    配置项描述: <forms name=".ASPXAUTH" loginUrl="login.aspx" defaultUrl="default.aspx" protection="All" timeout="30" path="/
  • Xamarin.Forms 5.0 来了

    2021-01-14 07:40:00
    Xamarin.Forms 5.0 已经正式发布,并带来其新功能,具体看官方博客https://devblogs.microsoft.com/xamarin/xamarin-forms-...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 82,753
精华内容 33,101
关键字:

forms