Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Reading a file content from code behind

$
0
0

Hi there,

Haven't got my code to hand but am hoping with the right help I wont need it (can post later though if I do!).

Basically, I've written a search facility on my site, written in asp.net, with code behind in vb.net. A search button and textbox are located on each form of the website. Once a user hits search the text is moved via url query string to a page called search. The search page has a page load event that fires off the search process. The seach process takes each asp.net page located within the directory, removes any jargon thus just extracting the 'text' from the page. This is stored in sql tables and ranked at a decimal, so in theory the most relevant matches searched yeilds the higher up the search results it will be. Not a brillant search facilty I must admit but does the job :)

Now for the prolem, when I run the application on my machine locally I get no errors , the search results are displayed all the content is added to the local sql tables etc etc. However, when i publish to my hosting provider remotely I get an error which looks like this:

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.

I am pretty confident that the error is because I am getting a webpage to try and read the content of another webpage (using the IO.StreamReader) and the webserver is saying hold on a minute whats going on here? . .

Question is how to tell my application/webserver that the code is okay to run and that it is just going to be reading the content of the page, it doesn't have to read any code behind/security data etc. Any one any ideas!?!

 


Viewing all articles
Browse latest Browse all 4737

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>