I know I can use the ConfigurationManager.AppSettings["VersionOfWebSite"] code to get value of the key VersionOfWebSite
Now I hope to get the value of from property in <smtp> (the value is user@hellocw.com), how can I do? Thanks!
//--------------------------Web.Config--------------------------------------
<?xml version="1.0"?><configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.net>
<mailSettings>
<smtp from="user@hellocw.com">
<network host="mail.hellocw.com" password="password" userName="username" />
</smtp>
</mailSettings>
</system.net><appSettings>
<add key="VersionOfWebSite" value="1.0"/>
</appSettings>
</configuration>
//--------------------------Web.Config--------------------------------------
SuperCool Multiple ZIP - A utility to unzip multiple files and work with multiple zip files
SuperCool Random Number Generator
![]() |
0 |
![]() |
Hello mycwcgr,
Check out the following link: http://community.strongcoders.com/blogs/ryan/archive/2006/03/25/625.aspx
Hope this helps.
www.hopeasp.net
![]() |
0 |
![]() |
Thanks!
SuperCool Multiple ZIP - A utility to unzip multiple files and work with multiple zip files
SuperCool Random Number Generator
![]() |
0 |
![]() |
It works well in local PC, but after I upload to remote hosting , I get the following error when I try to access it. does it mean your code can't work in any case? can I read web.config in this case?
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessPermission.Demand() +59
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +678
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +114
System.Configuration.Internal.InternalConfigHost.StaticOpenStreamForRead(String streamName) +80
System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName, Boolean assertPermissions) +115
System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName) +7
System.Configuration.Internal.DelegatingConfigHost.OpenStreamForRead(String streamName) +10
System.Configuration.UpdateConfigHost.OpenStreamForRead(String streamName) +42
System.Configuration.BaseConfigurationRecord.InitConfigFromFile() +443
SuperCool Multiple ZIP - A utility to unzip multiple files and work with multiple zip files
SuperCool Random Number Generator
![]() |
0 |
![]() |
Please help me, thanks!
SuperCool Multiple ZIP - A utility to unzip multiple files and work with multiple zip files
SuperCool Random Number Generator
![]() |
0 |
![]() |
This is because of the Security Level set on the remote-server.
Check out the following links:
http://forums.asp.net/thread/1693190.aspx
http://www.developerfusion.co.uk/forums/thread/142435/
www.hopeasp.net
![]() |
0 |
![]() |