securityexception

Creating directories in medium trust environment?

守給你的承諾、 提交于 2019-12-20 06:24:54
问题 I've got an ASP.NET Web Application running in a medium trust environment with a shared hosting provider. The following code causes a SecurityException to be thrown: private void TestButton_Click(object sender, EventArgs e) { string directory = Server.MapPath("~/MyFolder/") + "_TestDirectory"; if (!Directory.Exists(directory)) Directory.CreateDirectory(directory); } The full text of the error is: System.Security.SecurityException: Request for the permission of type 'System.Security

Java: Using Gson in an Applet causes SecurityException

ⅰ亾dé卋堺 提交于 2019-12-20 03:11:22
问题 I'm trying to use Google Gson in my Java Applet, but when I do I get Exception in thread "Thread-19" java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323) at java.security.AccessController.checkPermission(AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.reflect.AccessibleObject.setAccessible

External Storage Permission Issue with MediaProvider / Ring Tones

核能气质少年 提交于 2019-12-18 17:16:22
问题 Some of my users have reported to Google Play the following error when trying to select a ringtone in my app. (there's more to it, but it's not relevant) java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/audio/media from pid=5738, uid=10122 requires android.permission.READ_EXTERNAL_STORAGE I assume this issue is happening due to certain tones that are on external storage. I don't want to include the READ_EXTERNAL

External Storage Permission Issue with MediaProvider / Ring Tones

こ雲淡風輕ζ 提交于 2019-12-18 17:15:11
问题 Some of my users have reported to Google Play the following error when trying to select a ringtone in my app. (there's more to it, but it's not relevant) java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/audio/media from pid=5738, uid=10122 requires android.permission.READ_EXTERNAL_STORAGE I assume this issue is happening due to certain tones that are on external storage. I don't want to include the READ_EXTERNAL

Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin “https://localhost”

时光怂恿深爱的人放手 提交于 2019-12-18 11:51:38
问题 I am facing below issue while trying to capture click events of G + follow button. Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "https://localhost" from accessing a frame with origin "https://apis.google.com". Protocols, domains, and ports must match. 回答1: I found a similar discussion, Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFram. This issue fired when you try to call ajax

Calling WifiManager.startLocalOnlyHotspot() throws SecurityException even after granting all required permissions on some devices

允我心安 提交于 2019-12-13 03:14:04
问题 I am working on a file sharing app. I need to turn on local only hotspot of a device programmatically by calling WifiManager.startLocalOnlyHotspot(). According to the android docs on this page - https://developer.android.com/reference/android/net/wifi/WifiManager#startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback,%2520android.os.Handler), Applications need to have the following permissions to start LocalOnlyHotspot: Manifest.permission.CHANGE_WIFI_STATE and ACCESS

SecurityException was unhandled when using isolated storage

最后都变了- 提交于 2019-12-12 11:33:30
问题 When using this code I get the above error: var userSettings = new UserSettings() { Username = TextBox_Username.ToString(), Password = TextBox_Password.ToString(), Operator = OperatorList.O2 }; var settings = IsolatedStorageSettings.ApplicationSettings; settings.Add("UserSettings", userSettings); settings.Save(); I'm not sure why? though. 回答1: Fixed it. Any stored class needs to be marked as public marking classes internal is not allowed. The issue happened because C# does not default to

SecurityException on my java applet

冷暖自知 提交于 2019-12-12 03:09:21
问题 I am getting the java.lang.SecurityException: Permission denied: file:////Videos/public/scripts/screenshot.jar when I try to use an applet. Here is the applet code: <applet code="Screenshot" archive="file:////Videos/public/scripts/screenshot.jar" width="100px" height="100px"> </applet> I've signed the applet using this 3-step guide, but it doesn't seem it worked for me, as I am still getting the error. http://www.narendranaidu.com/2007/11/3-easy-steps-to-self-sign-applet-jar.html 回答1: Your

Performance counter throws SecurityException

。_饼干妹妹 提交于 2019-12-11 23:22:44
问题 This is the code: private static void CreateCounter() { if (PerformanceCounterCategory.Exists("DemoCategory")) PerformanceCounterCategory.Delete("DemoCategory"); CounterCreationDataCollection ccdArray = new CounterCreationDataCollection(); CounterCreationData ccd = new CounterCreationData(); ccd.CounterName = "RequestsPerSecond"; ccd.CounterType = PerformanceCounterType.NumberOfItems32; ccd.CounterHelp = "Requests per second"; ccdArray.Add(ccd); PerformanceCounterCategory.Create("DemoCategory

Clear another applications cache

眉间皱痕 提交于 2019-12-11 11:45:02
问题 I´ve been reading around here about cleaning another applications cahce-memory, and I´ve also tried coding my own app. The result I´ve got, is that with Androids current securitylayer, it´s not possible. But, there is currently many cache-cleaner applications out there on the Market (Google Play)? When I started my application which I gave the android.permission.DELETE_CACHE_FILES permission, the LogCat printed Not granting permission android.permission.DELETE_CACHE_FILES to package <MY