Total members 9951 | Gratitudes |It is currently Sat Feb 11, 2012 8:58 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 2 posts ] 
Author Question
 Question subject: Encrypt connection string
PostPosted: Wed Nov 05, 2008 6:10 pm 
Offline
Proficient
User avatar

Joined: Sun Oct 19, 2008 3:47 pm
Posts: 281
Has thanked: 0 time
Have thanks: 1 time

Hi,

Can anyone help to , I use ASP .Net in my project , I try to encrypt my
connection string in Web.config through OOP, I use this codes to encrypt the
"ConnectionStrings", but when I run the application , it does't work.

In
Class:ImportsMicrosoft.VisualBasicImportsSystem.ConfigurationImportsSystem.Web.C\
onfigurationImports
System.SecurityPublic
ClassEncConStrClassPublicSubEncryptConnStr(ByValprotectionProvider
AsString)''---open the web.config fileDimconfig AsConfiguration =
WebConfigurationManager.OpenWebConfiguration("")''---indicate the section to
protectDimsection AsConfigurationSection =
config.Sections("connectionStrings")''---specify the protection
providersection.SectionInformation.ProtectSection(protectionProvider)'---Apple
the protection and
updateconfig.Save()EndSubsection.SectionInformation.UnProtectSection()
config.Save()
End

In Form "Behind Code":ProtectedSubPage_Load(ByValsender AsObject, ByVale
AsSystem.EventArgs) HandlesMe.LoadDimX
AsNewEncConStrClass''X.EncryptConnStr("DataProtectionConfigurationProvider")X.En\
cryptConnStr(

N.B:
When I test this codes in form directly , it works & encrypted the
connectionstring
plz help me soon,"RSAProtectedConfigurationProvider")End
SubPublicSubDecryptConnStr()Dimconfig AsConfiguration =
WebConfigurationManager.OpenWebConfiguration("")Dimsection
AsConfigurationSection = config.Sections("connectionStrings")EndSubClass


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Encrypt connection string
PostPosted: Mon May 25, 2009 11:26 pm 
Offline
Newbie
User avatar

Joined: Tue May 19, 2009 10:33 pm
Posts: 2
Has thanked: 0 time
Have thanks: 0 time
AskBot wrote:
Hi,

Can anyone help to , I use ASP .Net in my project , I try to encrypt my
connection string in Web.config through OOP, I use this codes to encrypt the
"ConnectionStrings", but when I run the application , it does't work.

In
Class:ImportsMicrosoft.VisualBasicImportsSystem.ConfigurationImportsSystem.Web.C\
onfigurationImports
System.SecurityPublic
ClassEncConStrClassPublicSubEncryptConnStr(ByValprotectionProvider
AsString)''---open the web.config fileDimconfig AsConfiguration =
WebConfigurationManager.OpenWebConfiguration("")''---indicate the section to
protectDimsection AsConfigurationSection =
config.Sections("connectionStrings")''---specify the protection
providersection.SectionInformation.ProtectSection(protectionProvider)'---Apple
the protection and
updateconfig.Save()EndSubsection.SectionInformation.UnProtectSection()
config.Save()
End

In Form "Behind Code":ProtectedSubPage_Load(ByValsender AsObject, ByVale
AsSystem.EventArgs) HandlesMe.LoadDimX
AsNewEncConStrClass''X.EncryptConnStr("DataProtectionConfigurationProvider")X.En\
cryptConnStr(

N.B:
When I test this codes in form directly , it works & encrypted the
connectionstring
plz help me soon,"RSAProtectedConfigurationProvider")End
SubPublicSubDecryptConnStr()Dimconfig AsConfiguration =
WebConfigurationManager.OpenWebConfiguration("")Dimsection
AsConfigurationSection = config.Sections("connectionStrings")EndSubClass


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 2 posts ] 
Quick reply


  


 Similar topics
 Topic title   Forum   Author   Comments 
 replacing each tab by the string “Tab”,  C-C++  Anonymous  1
 Breaking the String into Words  Java examples  msi_333  1
 search for string in a cell array  Matlab Examples  msi_333  0
 Trim string in JavaScript  JavaScript examples  msi_333  0
 database connection  Java  katanor  1

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team