Welcome to Dream.In.Code
Become an Expert!

Join 150,428 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,074 people online right now. Registration is fast and FREE... Join Now!




How can i make apermission to the folderBrowserDialog when i use it as

 
Reply to this topicStart new topic

How can i make apermission to the folderBrowserDialog when i use it as

Mr.Error
8 Apr, 2008 - 05:16 AM
Post #1

New D.I.C Head
*

Joined: 13 May, 2007
Posts: 6


My Contributions
How can i make apermission to the folderBrowserDialog when i use it as activex ??

when i use it the application make this exeption @ the client browser (Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Windows.Forms.FolderBrowserDialog.get_SelectedPath() at mycontrol.UserControl1.button2_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows)


i hope someone answer me sooooooooon thanks for Your Attention smile.gif
User is offlineProfile CardPM
+Quote Post

Jayman
RE: How Can I Make Apermission To The FolderBrowserDialog When I Use It As
8 Apr, 2008 - 08:56 AM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,327



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
A web application does not have the necessary permissions to access the local computer.

The only way is to implement Impersonation.

I would not recommend this because it provides a huge security risk to your users.
User is offlineProfile CardPM
+Quote Post

Mr.Error
RE: How Can I Make Apermission To The FolderBrowserDialog When I Use It As
9 Apr, 2008 - 11:44 PM
Post #3

New D.I.C Head
*

Joined: 13 May, 2007
Posts: 6


My Contributions
to Know more about what i mean go to this link ( http://www.i-asu.com ) and use the browse button

p.s (the application contain activex control) .

thanks for Your attention .








QUOTE(jayman9 @ 8 Apr, 2008 - 09:56 AM) *

A web application does not have the necessary permissions to access the local computer.

The only way is to implement Impersonation.

I would not recommend this because it provides a huge security risk to your users.


User is offlineProfile CardPM
+Quote Post

Jayman
RE: How Can I Make Apermission To The FolderBrowserDialog When I Use It As
10 Apr, 2008 - 06:44 PM
Post #4

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,327



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
Yeah, maybe you should go visit the page again. There isn't a browse button on it.
User is offlineProfile CardPM
+Quote Post

Mr.Error
RE: How Can I Make Apermission To The FolderBrowserDialog When I Use It As
11 Apr, 2008 - 01:39 AM
Post #5

New D.I.C Head
*

Joined: 13 May, 2007
Posts: 6


My Contributions
QUOTE(jayman9 @ 10 Apr, 2008 - 07:44 PM) *

Yeah, maybe you should go visit the page again. There isn't a browse button on it.



no There is a browse button on it . ( http://www.i-asu.com/Default.aspx ) . if it dosn,t work tell me what u see ok . thnx for your attention
User is offlineProfile CardPM
+Quote Post

Jayman
RE: How Can I Make Apermission To The FolderBrowserDialog When I Use It As
11 Apr, 2008 - 07:43 AM
Post #6

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,327



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
I see that you have a UserControl in the code, but all that loads is a blank page.

Here is what I see.


Attached thumbnail(s)
Attached Image
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: How Can I Make Apermission To The FolderBrowserDialog When I Use It As
11 Apr, 2008 - 08:57 AM
Post #7

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 162 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Thats the same thing I see as well
User is offlineProfile CardPM
+Quote Post

Mr.Error
RE: How Can I Make Apermission To The FolderBrowserDialog When I Use It As
15 Apr, 2008 - 03:17 AM
Post #8

New D.I.C Head
*

Joined: 13 May, 2007
Posts: 6


My Contributions
QUOTE(PsychoCoder @ 11 Apr, 2008 - 09:57 AM) *

Thats the same thing I see as well




sorry don't use firefox or flok to see Internet Explorer it use ie to see it
User is offlineProfile CardPM
+Quote Post

Jayman
RE: How Can I Make Apermission To The FolderBrowserDialog When I Use It As
16 Apr, 2008 - 07:56 AM
Post #9

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,327



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
That button doesn't work for the very reasons I already told you.




Attached thumbnail(s)
Attached Image
User is offlineProfile CardPM
+Quote Post

Mr.Error
RE: How Can I Make Apermission To The FolderBrowserDialog When I Use It As
16 Apr, 2008 - 10:48 PM
Post #10

New D.I.C Head
*

Joined: 13 May, 2007
Posts: 6


My Contributions
i know it dosn't work i want to know the resone and how can i solve it . that is the main of my Topic Read the title well . Why it give me that exeption ?

this is the Code :


private void button2_Click(object sender, EventArgs e)
{
DialogResult dr = folderBrowserDialog1.ShowDialog();
new FileIOPermission(PermissionState.Unrestricted).Assert();
if (dr == DialogResult.OK)
{
new FileIOPermission(PermissionState.Unrestricted).Assert();
txt_brow.Text = folderBrowserDialog1.SelectedPath.ToString();
FileIOPermission.RevertAssert();
}
FileIOPermission.RevertAssert();
}





QUOTE(jayman9 @ 16 Apr, 2008 - 08:56 AM) *

That button doesn't work for the very reasons I already told you.


User is offlineProfile CardPM
+Quote Post

Jayman
RE: How Can I Make Apermission To The FolderBrowserDialog When I Use It As
17 Apr, 2008 - 08:28 AM
Post #11

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,327



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
Did you even read my very first post?!?

I gave you the answer to your question already.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 08:49PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month