file-extension

SaveFileDialog AddExtension doesn't work as expected

早过忘川 提交于 2019-12-04 15:20:40
I've the following C# code, which is using the SaveFileDialog and set's the AddExtension property to true : var dialog = new SaveFileDialog(); dialog.AddExtension = true; dialog.DefaultExt = "txt"; dialog.Filter = "Text files (*.txt)|*.txt|XML files (*.xml)|*.xml"; dialog.OverwritePrompt = true; if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { label1.Text = dialog.FileName; } And I've tested the following combination of File name and Save as type of the dialog. File name | Save as type | label1.Text | What I expect ----------------+----------------+----------------+----------

For a .Net project, what file extensions should I exclude from source control?

烂漫一生 提交于 2019-12-04 15:08:59
Everytime I start a project I have to think carefully about which files to exclude from source control. Has someone made a list of the criteria so I can look it up from the beginning? I work on my own so I have not got round to it. I appreciate that in the case of a DLL, you would want to include some and exclude others, so it is not just dependent on the file extension. My projects are ASP.Net, although a general discussion of other templates would also be useful. From http://blog.goneopen.com/2009/06/git-excludes-for-dotnet/ : .DS_Store ._* TestResults *Resharper* **.ReSharper** **\

Is it possible to find the file extension of a UIImage ?

冷暖自知 提交于 2019-12-04 13:14:18
问题 I found the below code in Finding image type from NSData or UIImage which helps to check four different image types of a UIimage (NSString *)contentTypeForImageData:(NSData *)data { uint8_t c; [data getBytes:&c length:1]; switch (c) { case 0xFF: return @"image/jpeg"; case 0x89: return @"image/png"; case 0x47: return @"image/gif"; case 0x49: case 0x4D: return @"image/tiff"; } return nil; } I want to know how to find the file is a bitmap image or not that it has .bmp extension. can someone

How to execute an event of already launched application with file association?

為{幸葍}努か 提交于 2019-12-04 11:44:53
After playing around with a new Windows Form project, I discovered that when you associate a file type with an executable in Windows, you can find the file path of the file that launched the application using args[0] from static void Main(string[] args) Is it possible to launch an event on your application when you double click a file if your application is already open? (As obviously Main(string[] args) won't be triggered). Example of an application with behavior I am attempting to replicate: User Opens GIMP(in Windows) User opens explorer and right clicks a .png file User selects open with

Get large icon from file extension

夙愿已清 提交于 2019-12-04 11:21:06
问题 There are several places that talk about how to get an icon from a file extension such as this one and this other one. After several hours of playing around with this kind of projects I have managed to build something like: private void addButton_Click(object sender, System.EventArgs e) { System.Drawing.Icon temp = IconReader.GetFileIcon(".cs", IconReader.IconSize.Large, false); pictureBox1.Image = temp.ToBitmap(); } the execution of that button gets me: but I am trying to actually get the

How to associate a Windows application with a particular file type but share that association with other applications?

对着背影说爱祢 提交于 2019-12-04 10:03:20
问题 If I create a new app, and associate with, say, the .xml file extension on a particular computer, when someone double clicks the .xml file, it will launch my app and pass the file as parameter. But Windows seems to know what other files have the ability to work with that file type. How is that set up? Also, when I save a Microsoft Word file as an .xml file, then later double-click on the file, it will launch Microsoft Word, even though the .xml file type is associated with something else,

Associating a file extension with my application

时光怂恿深爱的人放手 提交于 2019-12-04 09:35:51
I know how to manually associate a specific file or generic extension with a particular OS X application. (Get Info > Open with > Other…) I know how, in OS X, to drag-and-drop a file with an extension onto an 'unsupported' application. (Hold down command-option when dragging over the application) As the author of an OS X application, how can I specify that my application knows how to open a particular file extension? I want my users not to need to use command-option for drag-and-drop. I want my users to see my application listed under "Recommended Applications" instead of "All Applications"

How to find file extension of base64 encoded image in Python

浪子不回头ぞ 提交于 2019-12-04 05:01:18
I have a base64 encoded image that I decode and save into an ImageField in Django. I want to give the file a random name, but I don't know the file extension. I have "data:image/png;base64," prepended to the string and I know I could do some regex to extract the mimetype, but I'd like to know if there is a best practices way to go from "data:image/png;base64," to ".png" reliably. I don't want to have my handspun function break when someone suddenly wants to upload a strange image filetype that I don't support. It is best practices to examine the file's contents rather than rely on something

Custom file extensions for ASP.NET - help needed!

对着背影说爱祢 提交于 2019-12-04 04:09:02
问题 I've got modaspdotnet working on my Apache 2.2 server, and as such it runs ASP.NET and MySQL pretty well. However, what I'd like to do is serve up content with other extensions than just the default .aspx, e.g. myfile.customextension. In Apache, I believe it's done via .htaccess, but in ASP.NET it's done via the web.config. This is my web.config file: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> </system.web> <system.webServer> <staticContent> <mimeMap fileExtension="

File extension .DB - What kind of database is it exactly?

怎甘沉沦 提交于 2019-12-04 03:31:16
I have a database file with .DB file extension. I have been googling and it looks like SQLite. I tried to connect to it using SQLite and SQLite3 drivers and I am getting an error "File is encrypted or not a database". So I dont know if file is encrypted or it is not an SQLite database. Are there any other options what should the .DB extension should be? How do I find out that file is encrypted? I tried to open it in the text editor and it is mostly a mess of charaters and some times there are words visible. I have uploaded the file here: http://cl.ly/3k0E01373r3v182a3p1o for the closer look.