Solved

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

Posted on 2014-01-15
3
348 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now