file-access

System.ComponentModel.Win32Exception when starting process - file not found, but file exists

我只是一个虾纸丫 提交于 2019-11-30 09:12:30
问题 I am trying to create a manager for my autostarts. It should read an XML file and then start my programs with a custom delay. For example: <startup id="0"> <name>Realtek Audio Manager</name> <process arguments="-s">C:\Program Files\Realtek\Audio\HDA\RtkNGUI64.exe</process> <delay>5</delay> </startup> This runs the specified process ( C:\Program Files\...\RtkNGUI64.exe -s ) after 5 seconds. Now, three of the programs won't start, giving me a System.ComponentModel.Win32Exception : "Das System

Help securing files access with htaccess and php?

怎甘沉沦 提交于 2019-11-29 16:32:09
I'm working on a site that allows users to purchase digital content and have implemented a method that attempts to serve secure downloads. I'm using CodeIgniter to force downloads like this: $file = file_get_contents($path); force_download("my_file_name.zip", $file); Of course, I make sure the user has access to the file using a database before serving the download, but I was wondering if there was a way to make these files more secure. I'm using a some 8-10 letter keys to create the file paths so urls to the files aren't exactly easy to figure out... something like http://mysite.com/as67Hgr

Accessing linux local file system from java web application

跟風遠走 提交于 2019-11-29 15:38:38
we are using a java library inside a web application which is hosted in apache server.ReadConfFile method in library returns file not found error.The method is as follows public byte[] ReadConfFile() { try { File file = new File("/home/product/api/conf.txt"); if(!file.exists()) return "file not found".getBytes(); byte[] buf = new byte[(int) file.length()]; FileInputStream fis = new FileInputStream(file); fis.read(buf); return buf; } catch (IOException e) { e.printStackTrace(); return null; } } Is local file system access from web application allowed?. If yes , then is there any access

System.ComponentModel.Win32Exception when starting process - file not found, but file exists

不羁的心 提交于 2019-11-29 13:57:48
I am trying to create a manager for my autostarts. It should read an XML file and then start my programs with a custom delay. For example: <startup id="0"> <name>Realtek Audio Manager</name> <process arguments="-s">C:\Program Files\Realtek\Audio\HDA\RtkNGUI64.exe</process> <delay>5</delay> </startup> This runs the specified process ( C:\Program Files\...\RtkNGUI64.exe -s ) after 5 seconds. Now, three of the programs won't start, giving me a System.ComponentModel.Win32Exception : "Das System kann die angegebene Datei nicht finden." ("The system was not able to find the specified file.") But the

Checking if a file is in use without try catch?

北战南征 提交于 2019-11-29 09:26:46
Is there a way I can check if a file is in use or is not opened by other process without just trying to open it and catching an exception? Is there no service method to test such a thing? Even if there was, it wouldn't do you much good since you would still have to catch the exception in order to handle the race condition where the file became unavailable in between your initial check and your actual attempt to open/access it. I can't think of any compelling advantage to a preliminary defensive check. It just results in unnecessary code duplication. If there were such a IsFileAccessible

Howto synchronize file access in a shared folder using Java (OR: ReadWriteLock on network level)

橙三吉。 提交于 2019-11-29 07:29:48
I have multiple applications running in one virtual machine. I have multiple virtual machines running on one server. And I have multiple servers. They all share a file using a shared folder on linux. The file is read and written by all applications. During the write process no application is allowed to read this file. The same for writing: If an application is reading the file no application is allowed to write it. How do I manage to synchronize the applications so they will wait for the write process to finish before they read, and vice versa? (the applications inside a vm have to be

How do I restrict access to files with specific extensions in ASP.NET?

拥有回忆 提交于 2019-11-29 04:03:06
I have in my web application an ADO.NET Entity-Framework *.edmx file. When I browse in the browser (when the application is running) to an edmx file, it doesn't show the error page like when browsing to a *.cs or vb file, it opens the edmx and shows my model scheme to all the users!!! How can I avoid that. You can do this two ways; firstly in the web.config or secondly in IIS <system.web> <httpHandlers> <add verb="*" path="*.edmx" type="System.Web.HttpForbiddenHandler" /> </httpHandlers> </system.web> Here's a link to a microsoft support page that details how to do it in the web config and IIS

How do i resolve EXC_BAD_ACCESS errors encountered in iphone development

蓝咒 提交于 2019-11-28 18:52:12
I'm trying to do a simple thing; read an image from the internet, save it to the app's documents directory on the iphone, and read it back from that file so that i can do other things with it later. Writing the file works fine but when i try to read it back i get an EXC_BAD_ACCESS error in GDB that i have no idea how to resolve. Here is what my code basically looks like: -(UIImage *) downloadImageToFile { NSURL * url = [[NSURL alloc] initWithString: self.urlField.text]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString

Accessing linux local file system from java web application

笑着哭i 提交于 2019-11-28 10:17:03
问题 we are using a java library inside a web application which is hosted in apache server.ReadConfFile method in library returns file not found error.The method is as follows public byte[] ReadConfFile() { try { File file = new File("/home/product/api/conf.txt"); if(!file.exists()) return "file not found".getBytes(); byte[] buf = new byte[(int) file.length()]; FileInputStream fis = new FileInputStream(file); fis.read(buf); return buf; } catch (IOException e) { e.printStackTrace(); return null; }

How to access a variable across two files

那年仲夏 提交于 2019-11-28 08:39:50
I have three files - global.php, test.php , test1.php Global.php $filename; $filename = "test"; test.php $filename = "myfile.jpg"; echo $filename; test1.php echo $filename; I can read this variable from both test and test1 files by include 'global.php'; Now i want to set the value of $filename in test.php and the same value i want to read in test1.php. I tried with session variables as well but due to two different files i am not able to capture the variable. How to achieve this........ Thanks for help in advance..... Use: global.php <?php if(!session_id()) session_start(); $filename = "test";