Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 14th, 2007, 09:28 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default Request Code Execution Permission Problem

The backstory to this thread can be found here:
http://p2p.wrox.com/topic.asp?TOPIC_ID=60304

Essentially what I am trying to do is run a windows application off of a Thumbdrive over and RDP (Remote Desktop) session.

Since the thumbdrive is not recognized as a physical drive, the application on the thumbdrive does not get executed with Full Trust permissions. (Also, the code CANNOT be executed on the thin client where the Remote Desktop Session is being instantiated from)

So when the application is run all of my IO calls fail horribly since the code is running in partial trust. There are only 2 methods that I make calls to which are offending:

Application.StartupPath
and
System.Security.Principal.WindowsIdentity.GetCurre nt().Name.ToString()

I have only tried to deal with one thus far:

System.Security.Permissions.FileIOPermission p = new System.Security.Permissions.FileIOPermission(Syste m.Security.Permissions.FileIOPermissionAccess.AllA ccess, Application.StartupPath);

and then on a subsequent line i call

p.Demand();

Unfortunately, my code never reaches p.Demand() and I throw an I/O exception in the first tidbit of code.

The error is: Request Permission Failed. (I have also tried to lower the Access to Read which also generates the same error)

I have looked into add the application to a Full Trust zone via UNC but, unfortunately, I do not have the ability to add UNC paths to my thin clients!!

(Doing \\[thinclientname\ I am unable to see the thumbdrive so I am unable to add a UNC path)

So:
1) Am I requesting permissions incorrectly
2) If not, is there anyway around this problem?

Thanks in advance!

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================





Similar Threads
Thread Thread Starter Forum Replies Last Post
Proc execution failed from CS code nkrust ASP.NET 2.0 Professional 0 August 30th, 2007 01:28 AM
Request for the permission of type 'System.Net.Web paranthaman ASP.NET 1.0 and 1.1 Professional 1 August 21st, 2006 10:16 AM
Permission Request from Microsoft Jet Provider Griffinite Classic ASP Databases 5 December 17th, 2004 01:28 PM
Code Execution Stops for No Known Reason tcarnahan Access VBA 6 October 28th, 2003 04:00 PM
Run-time code execution module0000 Beginning VB 6 1 June 20th, 2003 04:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.