简体   繁体   中英

Visual Studio - Read specified file on launch

I'm working with a simple program that has to read data from a txt file and than display it. The thing is that i would like to read a specified extension files (for example .log) automatically.

So, i would like to do it as a simple Windows user - double click file and than the program opens. The problem is that this program is working but it's nor loading the file on start and tbh i have no idea if I should program it somehow? Any hints?

Thanks!

Sound like you want to associate file type with your application. This is done via windows registers. Try for example this article http://msdn.microsoft.com/en-us/library/windows/desktop/hh127451(v=vs.85).aspx

The easiest way to make it load the file automatically is to allow it accept the file path as a parameter and then do a load operation. As for having your program open automatically when a user double clicks on that file type I would recommend checking out this CodeProject

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM