NET transplanting case learns:Build Web site (2)
Tuesday, March 03, 2009 by rain
mixes site transplanting to Visual Basic.NET the first pace of.NET frame is to look what method can offer an alternative.Three kinds of methods can be used now:
· transplants the component of site and Visual Basic 6.0 ASP.NET and Visual Basic.NET
· transplants the site to ASP.NET,Reoccupy COM+ Interoperability and communication of existent component of Visual Basic 6.0
· does not transform existent site,And the new functional module that writes with ASP.NET and Visual Basic.NET through increasing will expand the function of the site
Before is beginning to develop,Development group decided in using the what function module of.NET to replace a website complex,And the code that can have a problem sometimes,Increase a few new functions.Tell specificly,They hope to press the requirement of the face rebuilds website:
· replaces original user safety mechanism with ASP.NET attestation
· affirms with ASP.NET Web Form accuse will replace client end to be used at reporting product flaw and descriptive defect identify logic really
· uses ASP.NET Web Services to enter the website dissolve of Microsoft other flaw of Beta edition product to report the system is medium
This locality that · uses.NET frame changes a function to build to be able to realize the Web site that this locality converts very easily
· uses ASP.NET to provide personalized menu and banner picture to the user
to make full use of these characteristics,Development group decision becomes ASP page transplanting ASP.NET page.They will not transplant the ActiveX component of existent Visual Basic 6.0,Found package of new Visual Basic.NET to realize Web Service and this locality to change however.
lets us look now to finish transplanting,What to do to revise after all to this website.
combines function of ASP.NET attestation
The first pace that transplants uses the attestation mechanism that Cookie is based on in ASP.NET to replace original client safety mechanism namely.Mechanism of this kind of safe attestation appears in PDC technology to preview above all in,Got developing in Visual Studio.NET Beta 1.Its target is to decide who is visitting a website,is not to prevent an user to visit.Because of this,Development group revised membership system,Help user registers Web site,And be in product of edition of the following Beta can continue to use.
The purpose of the person that identifies every visit is to dog the flaw that they report and defect,Have necessary communication with them,With solving a problem thoroughly.Send specific check out stand the drop besides the feedback the user,The user is OK still and custom-built this site,With satisfying oneself need,On the news that helps a client focus attention in them to need.The content connection that is interested in user and them rises can help site manager understand an user to be interested in what problem most.The content that most test site included each fields of Visual Studio.NET and.NET frame,Allow an user to visit all documentation on the site,But certain use at specific respect (for instance Visual Studio.NET IDE Shell is rectified and) the documentation that checks a site to use filter to offer them to be interested only to the client.
The method that the attestation means that uses formerly uses an ASP server to carry file and place of component of a Visual Basic to offer,The member that whether the user ID that place of the person that test and verify calls in offers and password are a database.This file was offerred but code of put sb in a very important position will complete safe inspection,But this means this file to need to be included in the begin of each page,Ability assures this one page to won't be opened by the user without crossing attestation.The page that includes this file not to need safe protection to administrator configuration in each page brought a trouble.
It is very easy that realizes attestation in ASP.NET,The protection that because be based on the attestation of Cookie to be deposited through the documentation the site,realized pair of documentation in the folder with specific certain.When the documentation that attempts to visit this to get protection when the user,Whether did.NET frame pass automatic judgement user attestation.If user not by attestation,.NET frame can weigh this request without attestation directional to the HTML watch sheet with specific certain,Let an user input attestation information,Submit this watch sheet.If the user got attestation,.NET frame can produce to be able to discern the Cookie of the user,Pay equal attention to directional to former request page..NET frame still offerred a few kinds to help we and attestation process save the attestation information in Cookie with the visit interactively.
We can use the attestation system that the Config.web file of Web site will come to configure ASP.NET.This configuration file included to be used at appointing attestation means piece, the format that this piece points to to clear HTML lands the URL that expresses sheet and password.Graph the 3 Config.web files that are the attestation that a setting is based on Cookie.
The person that the sort of original safe attestation means on site of Web is visited for each is exclusive establish ID of a dialog.Because had generated this ID,So we do not alter in transplanting attestation process existent code.Mechanism of ASP.NET attestation will weigh the user without attestation directional to land a page,Let an user refer L/C.Once was referred,land a page,User ID and password will be affirmed,Still will produce a conversational ID.
System of attestation of ASP.NET of implementation should revise two original places that land a page only.The key word that we did not write initiate word to the client's Cookie,Used Cookie of ASP.NET attestation however,Establish its value the key word that is conversation.Pass CookieAuthentication next kind RedirectFromLoginPage method leads the user former request page afresh.Be in next in the request,The HttpContext.User that will pass.NET frame kind will visit conversational ID.Graph 4 those who show is the entry attestation examination after revising.
besides the safe attestation system that provided a kind of safer, easier implementation,System of ASP.NET attestation still can distinguish those who treat attestation to pass to mix the content without attestation.Because protective limits is,decide by the catalog structure in Config.web file,Should move content only so gave the folder that gets protection to be able to cancel the protection that allows internally.
can produce effect to let attestation mechanism,All patulous names that need the document that attestation just can visit should instead.aspx (the patulous name of ASP.NET file) .No less than you will see below,This is a relatively simple procedure.