file

C# - Associate a file type and open it within WebBrowser control?

How would I be able to open a file (lets say an .html file) and load it into the WebBrowser control on my WinForm application? I'm talking about right clicking on the file and choosing to open it with my application. Any ideas? ...

java - effective files copying

hi. i would like to know which is the best way to copy large number of files. ...

C# locking read while writing binary file

Hi, I am trying to figure out how to write a binary file with a FileStream and BinaryWriter, and keep the file locked for read while I am writing. I specifically dont want other applications/processes to be able to read from the while while its being written to. //code to declare ba as a byte array //dpath is the path to the file Fi...

File Handling Issue

hi all, I am developing a tool in c#, at one instance I start writing into a xml file continuously using my tool,when i suddenly restart my machine the particular xml file gets corrupted, what is the reason an how to avoid it? xmldocument x= new xmldocument(); x.open(); // change a value of the node every time x.save(); x=null this i...

Is File.Exists an expensive operation?

Re: http://msdn.microsoft.com/en-us/library/system.io.file.exists.aspx Does anyone know if this is a particularly slow or locking operation which could impact server performance in a large environment? Thanks, Matt. ...

PHP Determining a file based on parameters in regular expression

I'm trying to determine a file based on specific parameters. First, I am recursively iterating through a directory structure such as the following: C:/Users/programmer/Downloads/reviews/XBOX C:/Users/programmer/Downloads/reviews/PS3 C:/Users/programmer/Downloads/reviews/GBA Please notice the console game type at the end of the string...

Determine thread which holds the lock on file

Hi, I know there is no WINAPI which would do it, but if a thread is hung and holds an open handle of file. how do we determine the thread id and Terminate it within our processes. I'm not talking about releasing file locks in other processes but within my own process. it could also be possible that thread has crashed / terminated with...

newbie sinatra question

To return a file using sinatra, I had been using this: get '/:name' do x = File.open('c:/mywebsite/' + params[:name],'r') end where the incoming url is "http://localserver:4567/myfile.html. It works, but it occurs to me there must be a better way, yet I can't find the preferred mechanism on the sinatra site. ...

Parse out the file extension from a file-path in C

I was previously using the following code to determine if a file was an .exe or .o file and thus set binFile to 1: if(strstr(fpath,".exe") != NULL || strstr(fpath,".o") != NULL) binFile = 1; Through debugging, I noticed that this method will also set binFile to 1 with files like foo.out or foo.execute. What I really want is...

File transfer using ipmsg

Hello everyone, How can we send a file using g2ipmsg? Thanks in advance. ...

where is onet.xml ?

i create the site collection by central administration , i want see its ONET.XML. where is that exist ? Also as per my knowledge the master page declaration is declare in onet.xml right ? i want to change my master pages names , how to do that? please don't suggest sharepoint designer use. I used it & really it is best . but what is the...

Different ways of reading and writing files in C#

Hi, I am trying to understand different ways of reading and writing files with their advantages and disadvantages. Like when to use TextWriter/TextReader when File.Create or StreamReader/StreamWriter FileStream etc. When to use what? ...

How to touch a file in C#?

In C#, what's the simplest/safest/shortest way to make a file appear as though it has been modified (i.e. its last modified date) without changing the contents of the file? ...

save Exceptions to file in python

Hello, I want to save all following Exceptions in a file. The reason why I need this is because the IDLE for python 3.1.1 in Ubuntu raises an Exception at calltipps, but close to fast, that it isn't readble. Also I need this for testing. The best, would be if I just call a function which saves all Exception to a file. Thank you! ;) // e...

WPF - where can I find some Resource files that will really make my datagrids stand out?

I'd like to make my WPF datagrids really "pop" in my application. Is there a repository of really good resources files out there that I can use to apply to my datagirds? I've already used some from the silverlight toolkit but I'm sure there must be more out there. ...

practical examples use dup or dup2

Hi, I know what does dup or dup2 do ,but I have no idea when it would be used. Any practical examples? Thanks. ...

Logic for a file compare

I trying to write a programm for file compare. For example: file1 1 2 3 4 5 file2 1 2 @ 3 4 5 If I do it line by line, I get: 1 == 1; 2 == 2; 3 != @; 4 != 3; 5 != 4; != 5; But, the truth is that the only difference between the files is @. I want get something like this: 1 == 1; 2 == 2; != @; 3 == 3; 4 == 4; 5 == 5; Whic...

Inserting to the database while uploading a file

Hi, I have a code in my asp.net page where I am inserting some data in the database while uploading a file to the server. The problem is, it seems that the application is waiting for the file to be uploaded before it will insert to the database. Below is a code similar to mine. public partial class _Default : System.Web.UI.Page { ...

Getting a text file into a two dimensional ragged array in Java.

Hey guys this is a followup to my previous question. I now have a text file which is formatted like this: 100 200 123 124 123 145 What I want to do is get these values into a two dimensional ragged array in Java. What I have so far is this: public String[][] readFile(String fileName) throws FileNotFoundException, IOException { ...

Better way to share header file between separate vc project?

How would you organize your vc projects source code to share the same header file? put the header in a common folder, and have every vc projects include it. put the header in a vc project, and have the other projects include it as a link. copy the header file into every vc project any better solution? ...