Solved

com object can't access local file system from web page

Posted on 2014-01-15
3
355 Views
Last Modified: 2014-01-31
I have created a c# dll that is a com object.  It is embedded on the webpage using the <object> tag.  It works fine.  

I now have a requirement to access a file in the program files folder that has some setup values, but I can't do it from a webpage on the server.  

The dll is downloaded with a windows application and regasm is run prior to opening the website.  The dll can access a database (from the web page).  how can I grant permissions to the object that allows local file access?  The access only needs to be read access.
0
Comment
Question by:dhenderson12
  • 2
3 Comments
 
LVL 25

Expert Comment

by:apeter
ID: 39785022
Maybe you can read the file from windows application and pass as query parameters when the website is launched ?
0
 

Author Comment

by:dhenderson12
ID: 39785257
Interesting idea, however there are several of these sites and I would need to modify the way they are launched individually, so this would become a maint nightmare.

I would like to write a small file when the win application starts up and allow the com object access to that file for the information it needs.  I just don't know how to do this for a .net object.  If it were java I would install a java.policy file on the machine (since these are internal sites that's easier than it sounds through group policy).
0
 
LVL 25

Accepted Solution

by:
apeter earned 500 total points
ID: 39785520
Please check whether it can useful to you.  Reading file using vbscript.  http://www.developerfusion.com/code/1656/reading-a-file-using-the-filesystemobject/

Other option is , you can store the setup values in DB and when the application launches first it can read its setup values and it can proceed further.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question