[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

09/19/2004 at 08:48AM PDT, ID: 21136754
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

Permission Exception thrown while accessing a network file from a web service.

Asked by MAIGUI77 in Programming for ASP.NET

Tags: network, exception, permission

Hello Experts,

I am trying to re-write an existing web application as a web service. The application needs to access files that reside on
another computer within our network (through a mapped drive),therefore we are using Impersonation to grant
permissions to the aspnet_wp.exe process.


The Web App works fine, but within the web Service, a permission exception is thrown at second line of the following code:
(note: the web service resides on the same machine that the web app resides on.)


string path = @"E:\Images\Image1.jpg";
System.Drawing.Image myImage = System.Drawing.Image.FromFile(path);


(if I copy the file to my local C: and then try to access it through the web service, it works perfectly)

string path = @"C:\Images\Image1.jpg";
System.Drawing.Image myImage = System.Drawing.Image.FromFile(path);


In an attempt to see why it is working in an aspx page, but not in a web service, I tried to see exactly what
was being impersonated in the web app and the web service by using the following code:

string strUser = User.Identity.Name;

in the Web app, strUser is equal to the username that I use to log onto my machine.
however, in the Web Service, strUser is equal to an empty string, I'm not sure why this is.

Can someone please tell me why User.Identity.Name returns an empty string in the web service,
and help me solve this permissions dilemma.

Thanks in advance,
MAI
[+][-]09/19/04 08:59 AM, ID: 12096018

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Programming for ASP.NET
Tags: network, exception, permission
Sign Up Now!
Solution Provided By: mmarinov
Participating Experts: 4
Solution Grade: B
 
 
[+][-]09/19/04 02:09 PM, ID: 12097490

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09/20/04 06:34 AM, ID: 12101922

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09/20/04 07:10 PM, ID: 12108524

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/22/04 12:39 AM, ID: 12120527

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09/23/04 03:57 PM, ID: 12138588

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74