Prev: Uploading file to UNIX host
Next: Menu od child windows
From: Tony Johansson on 13 Apr 2010 16:41 Hi I have the program below which is from Microsoft Press exam 70-536 When I run this program I get this output C:\>listpermissions.exe System.Security.Permissions.FileIOPermission: True System.Security.Permissions.EnvironmentPermission: True System.Security.Permissions.FileDialogPermission: True System.Security.Permissions.IsolatedStorageFilePermission: True System.Security.Permissions.ReflectionPermission: True System.Security.Permissions.UIPermission: True System.Drawing.Printing.PrintingPermission: True If I run the program in this way I got the same output. C:\>\\127.0.0.1\c$\listpermissions.exe System.Security.Permissions.FileIOPermission: True System.Security.Permissions.EnvironmentPermission: True System.Security.Permissions.FileDialogPermission: True System.Security.Permissions.IsolatedStorageFilePermission: True System.Security.Permissions.ReflectionPermission: True System.Security.Permissions.UIPermission: True System.Drawing.Printing.PrintingPermission: True According to the book I should get false for some of them because when I run by using 127.0.0.1 it being run from a shared folder, so it is running from Internet zone but as you saw I get the same output whether I run it like this C:\>listpermissions.exe or this C:\>\\127.0.0.1\c$\listpermissions.exe The permission that the Internet_zone has is File Dialog Isolated Storage Security User Interface Printing class Program { static void Main(string[] args) { writePermissionState(new FileIOPermission(PermissionState.Unrestricted)); writePermissionState(new EnvironmentPermission(EnvironmentPermissionAccess.Read, "USERNAME")); writePermissionState(new FileDialogPermission(FileDialogPermissionAccess.Open)); writePermissionState(new IsolatedStorageFilePermission(PermissionState.Unrestricted)); writePermissionState(new ReflectionPermission(ReflectionPermissionFlag.MemberAccess)); writePermissionState(new UIPermission(UIPermissionWindow.SafeTopLevelWindows)); writePermissionState(new PrintingPermission(PrintingPermissionLevel.SafePrinting)); Console.WriteLine("\nPress Enter key to continue"); Console.Read(); } static private void writePermissionState(CodeAccessPermission p) { // Write True or False depending on whether the user has the permission Console.WriteLine(p.GetType().ToString() + ": " + SecurityManager.IsGranted(p)); } } Does anyone has some suggestion why the output is the same it shouldn't be ? //Tony
From: GS on 14 Apr 2010 00:14 are you sure 127..0.0.1 is in the internet zone on your pc instead of local intranet?
From: Tony Johansson on 14 Apr 2010 01:39 "GS" <gsmsnews.microsoft.comGS(a)msnews.Nomail.com> skrev i meddelandet news:OKS8qj42KHA.1016(a)TK2MSFTNGP02.phx.gbl... > are you sure 127..0.0.1 is in the internet zone on your pc instead of > local > intranet? > How do I check if it's in the Internet zone or the local internet ? I mean to judge from the output it would be the local internet and not the Internet zone. So why do the book says that it would be the Internet zone ? Is it possible to configure so 127.0.0.1 would be the Internet zone ? //Tony
From: Karl Mitschke on 14 Apr 2010 10:44 Hello Tony, > "GS" <gsmsnews.microsoft.comGS(a)msnews.Nomail.com> skrev i meddelandet > news:OKS8qj42KHA.1016(a)TK2MSFTNGP02.phx.gbl... > >> are you sure 127..0.0.1 is in the internet zone on your pc instead of >> local >> intranet? > How do I check if it's in the Internet zone or the local internet ? > I mean to judge from the output it would be the local internet and not > the > Internet zone. > So why do the book says that it would be the Internet zone ? Is it > possible to configure so 127.0.0.1 would be the Internet zone ? > > //Tony > 127.0.0.1 is localhost.... Karl http://unlockpowershell.wordpress.com/
|
Pages: 1 Prev: Uploading file to UNIX host Next: Menu od child windows |