Click here to Skip to main content
15,906,333 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to access internal methods Pin
Heywood28-Apr-09 4:52
Heywood28-Apr-09 4:52 
AnswerRe: How to access internal methods Pin
S. Senthil Kumar30-Apr-09 9:56
S. Senthil Kumar30-Apr-09 9:56 
Questionassigning ownership of files and folders??? Pin
lane0p228-Apr-09 4:22
lane0p228-Apr-09 4:22 
Questionc# or c++ image processing? Pin
Jon Hulatt28-Apr-09 3:58
Jon Hulatt28-Apr-09 3:58 
QuestionRe: c# or c++ image processing? Pin
led mike28-Apr-09 9:05
led mike28-Apr-09 9:05 
AnswerRe: c# or c++ image processing? Pin
Jon Hulatt28-Apr-09 21:35
Jon Hulatt28-Apr-09 21:35 
QuestionRe: c# or c++ image processing? Pin
led mike29-Apr-09 5:36
led mike29-Apr-09 5:36 
Questiondll security flaw Pin
ferroariel28-Apr-09 3:30
ferroariel28-Apr-09 3:30 
Hi u all!!!

I have a website, dedicated to beauty products for women, ok? Sometime ago a friend of mine told me "hey! why don´t you send that info through MSN?". I liked that, so I downloaded an autoresponder code from here:

http://nayyeri.net/blog/auto-responder-add-in-for-windowsConfused | :confused: -live-messenger/

So I simply added this routine to get search results from my site:

public string getSiteSearchResults()
        {   string reader = "";
            string search = "[the received message text goes here]";
            string url = "[the URL of my website search page]?query="+ search;
            try            
            {
                WebPermission pWeb = new WebPermission(NetworkAccess.Connect, url);
                SecurityPermission pSec = new SecurityPermission(SecurityPermissionFlag.AllFlags);
                PermissionSet set = new PermissionSet(PermissionState.None);
                set.AddPermission(pWeb);
                set.AddPermission(pSec);
                set.Assert();
                HttpWebRequest URLReq = (HttpWebRequest)WebRequest.Create(url);                
                URLReq.Credentials = CredentialCache.DefaultCredentials;
                URLReq.AuthenticationLevel = System.Net.Security.AuthenticationLevel.None;
                URLReq.AllowAutoRedirect = true;
                URLReq.Timeout = 60000;                
                HttpWebResponse URLRes = (HttpWebResponse)URLReq.GetResponse();                
                Encoding enc = Encoding.GetEncoding(1252); 
                StreamReader sStream =   new StreamReader(URLRes.GetResponseStream(), enc);            
                reader = sStream.ReadToEnd();                
            }
            catch (Exception ex)
            {
                reader = ex.Message ;
            }                       
            return (reader);                
        }


So when somebody asks for some product, the addin (working on one of my pcs) do a search on my site, get the results and send ´em in response as plain text.

Well, instead of that, all I get is this:

Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.


I read about gacutil, regasm, caspol, trust zones, trusted assembly, security zones...... but don´t have a clue where to start to get rid of this thing, really.

Any help is truly appreciated

Txs in adv

Ariel
Question[Message Deleted] Pin
bhargava240928-Apr-09 3:01
bhargava240928-Apr-09 3:01 
AnswerRe: 3D Auto Cadd viewer Pin
musefan28-Apr-09 3:05
musefan28-Apr-09 3:05 
AnswerRe: 3D Auto Cadd viewer Pin
Simon P Stevens28-Apr-09 3:49
Simon P Stevens28-Apr-09 3:49 
General[Message Deleted] Pin
bhargava240930-Apr-09 2:02
bhargava240930-Apr-09 2:02 
GeneralRe: 3D Auto Cadd viewer Pin
Simon P Stevens30-Apr-09 2:50
Simon P Stevens30-Apr-09 2:50 
QuestionSolid Works Image To My C# Project Pin
bhargava240928-Apr-09 2:58
bhargava240928-Apr-09 2:58 
AnswerRe: Solid Works Image To My C# Project Pin
musefan28-Apr-09 3:03
musefan28-Apr-09 3:03 
GeneralRe: Solid Works Image To My C# Project Pin
bhargava240930-Apr-09 2:24
bhargava240930-Apr-09 2:24 
GeneralRe: Solid Works Image To My C# Project Pin
bunyaminasd24-Nov-09 21:25
bunyaminasd24-Nov-09 21:25 
Questionhow we reterive image from sql database using browse button Pin
shomic.goyal28-Apr-09 2:44
shomic.goyal28-Apr-09 2:44 
AnswerRe: how we reterive image from sql database using browse button Pin
jaipurguy128-Apr-09 2:47
jaipurguy128-Apr-09 2:47 
AnswerRe: how we reterive image from sql database using browse button Pin
musefan28-Apr-09 2:53
musefan28-Apr-09 2:53 
GeneralRe: how we reterive image from sql database using browse button Pin
shomic.goyal28-Apr-09 3:04
shomic.goyal28-Apr-09 3:04 
GeneralRe: how we reterive image from sql database using browse button Pin
musefan28-Apr-09 3:07
musefan28-Apr-09 3:07 
AnswerRe: how we reterive image from sql database using browse button Pin
nagendra.vk28-Apr-09 5:43
nagendra.vk28-Apr-09 5:43 
QuestionProblem to display Master-Details rows. Pin
hdv21228-Apr-09 2:41
hdv21228-Apr-09 2:41 
QuestionFormula Translation Pin
punitxsmart28-Apr-09 1:56
punitxsmart28-Apr-09 1:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.