Results 1 to 7 of 7

Thread: Security Exception

  1. #1
    Join Date
    Sep 2006
    Posts
    210
    Thanks
    1
    Thanked 6 Times in 6 Posts

    Default Security Exception

    Hi All

    I have a problem with this line of code
    Dim req As HttpWebRequest = CType(WebRequest.Create(PayPal_Url), HttpWebRequest)

    The variable PayPal_Url is what it say's for using the Pay Pal std payments, but I get a security exception when I try and run this line of code in a Medium trust environment, so can anyone tell me how to re write please.



  2. #2
    Join Date
    Oct 2006
    Posts
    38
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    have you tried...

    Code:
     
    Dim request As WebRequest = WebRequest.Create(PayPal_Url)
    request.Method = "POST"

  3. #3
    Join Date
    Sep 2006
    Posts
    210
    Thanks
    1
    Thanked 6 Times in 6 Posts

    Default

    Hi

    Thanks for that but it did not work this bit throws an security exception,

    WebRequest.Create(PayPal_Url)

    I know it's to do with Medium Trust Environment, but don't know how to code arround it, or even if it's possible

    Anyone else any ideas?

  4. #4
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    What is the exact security exception?
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  5. #5
    Join Date
    Sep 2006
    Posts
    210
    Thanks
    1
    Thanked 6 Times in 6 Posts

    Default

    Hi

    This is the exception

    System.Security.SecurityException was unhandled by user code
    Message="Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
    Source="mscorlib"
    StackTrace:
    at System.Security.CodeAccessSecurityEngine.Check(Obj ect demand, StackCrawlMark& stackMark, Boolean isPermSet)
    at System.Security.CodeAccessPermission.Demand()
    at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint)
    at System.Net.HttpRequestCreator.Create(Uri Uri)
    at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
    at System.Net.WebRequest.Create(String requestUriString)
    at ShoppingCart.Handler_Ipn.Page_Load(Object sender, EventArgs e)
    at System.Web.UI.Control.OnLoad(EventArgs e)
    at System.Web.UI.Control.LoadRecursive()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


    Thanks

  6. #6
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Open a support ticket and I will look into this for you...
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  7. #7
    Join Date
    Sep 2006
    Posts
    210
    Thanks
    1
    Thanked 6 Times in 6 Posts

    Default

    Hi

    Will do many thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. DNN issues security alert for 3.3.6/4.3.6
    By Tanzy in forum DotNetNuke (ASP.NET)
    Replies: 0
    Last Post: 4th December 2006, 10:06 AM
  2. Social Security Sex
    By Sol in forum Jokes and Stories
    Replies: 6
    Last Post: 18th October 2005, 06:07 PM
  3. MySQL security and PHP
    By ptermx in forum PHP
    Replies: 5
    Last Post: 14th October 2005, 02:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •