Thank you for your link. I think this will solve my problem. I will take a closer look. :)
Mika Larramo
Posts
-
Check that an EXE file is code signed / digitally signed? -
Check that an EXE file is code signed / digitally signed?Does anyone know how (from C/C++) check if an EXE file is code signed / digitally signed? And how to get the company name that has signed the file? I need to create a function (in C/C++) that starts an EXE file with a known filename, but for security reasons I must first check that this is the original file (check that nobody has replaced the file with another one with same filename). I know how to get version information from an EXE file, but reading code signing info will make the function much safer.
-
How many people have NET Framework 2.0 (or later) installed?It would be interesting to know how many percent of for example the Windows XP users really have NET 2.0 installed, but there are maybe no official statistics here to read. But I guess the number of people having NET 2.0 or above is increasing very fast, because more and more program uses it and installs it. And in Vista it is always included (as part of 3.0).
-
How many people have NET Framework 2.0 (or later) installed?Yes. I will of course check if NET Framework is installed, as the first thing I do, and start an installation if not. But I am just worried it will take a very long time. NET Framework is big and people expects a menu appear immediately. But I have to do some tests and see how long time it will take. And see how the user experience is if they need to wait long time before the menu appears.
-
Question about the IIS log file folder (is there a general way to get the folder path?)I am creating ASP.NET pages that need to read log information from the IIS log file. I want to count IP numbers in the log to get some visitor statistics. The problem is that the web site is hosted in a server that is shared with other companies and web sites. I have FTP access to the folder that contains log files to my account, but I don't know how to get access to that folder from ASP.NET code. Using Server.MapPath seems not to work because the log files is at same level at the "wwwroot" folder. They are stored like this: /logs /wwwroot This is how it is seen via a FTP client. "wwwroot" contains all web pages. "logs" contain the log files. I have also tried hard code some folder paths (checking with DirectoryExists), but without success. Is there any general way to obtain the folder path to the IIS log folder? Any class or function that can return the path? Or is there any general way to read information in IIS log files? I can not just figure out how to read the log files in that folder...
-
How many people have NET Framework 2.0 (or later) installed?Hi there, I plan to create a menu interface program for CD/DVD that uses classes from .NET Framework 2.0. There are some powerful classes in .NET that I want to use instead of creating them by myself to reduce the developing time. This menu program should be started automatically when the user inserts the CD/DVD in the drive. This is done by using the AutoRun technology in Windows. The problem is that if .NET Framework 2.0 is not installed in the computer this program can not be started. Then the user must first install .NET Framework 2.0 before the program can be run. Well, this is a common problem to all .NET programs and normally maybe this is not a big problem, but this program is supposed to show a menu interface immediately, and, I guess most users expect that, always... I know that Windows Vista always have .NET Framework 2.0 installed and I guess most Windows XP users today also have it. But I have never found any statistics about this. Does anybody know an Internet site that have statistics about how many people that uses .NET Framework 2.0, and the other versions of .NET Framework? Does Microsoft have some statistics? /Mika
-
How can I hide mouse pointer when it comes over my windowYou can use the ShowCursor Windows API function to show and hide the mouse pointer.
-
How can i detect the the Program Files FolderAbout your first question. You can read the ProgramFilesDir value at:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
in Registry. Then you will obtain the current path of the Program Files Folder in the system. You can use RegOpenKey and RegQueryValueEx Windows API functions to read the path from the Registry. -
Create relative path from 2 absolutesYou can use the _fullpath function in C/C++.
-
Can I declare a path with a single "\"Sometimes it can create very strange bugs if you forget one double backslash in a path... I have never liked this, but I have learned to live with it...
-
Startup computer automaticallyI'm not sure what you mean, but if you mean to restart a computer at specified time it is possible of course. Below you have a function for rebooting the computer. It works with all Windows versions. Call it with the in parameter EWX_REBOOT and the system will be rebooted:
BOOL WindowsExitOrReboot(UINT flags) { if (IsWindowsNT()) { // Windows NT etc HANDLE hToken; TOKEN_PRIVILEGES tkp; // Reset last error SetLastError(ERROR_SUCCESS); // Get a token for this process. if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) return FALSE; // Get the LUID for the shutdown privilege. LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tkp.Privileges[0].Luid); tkp.PrivilegeCount = 1; // one privilege to set tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; // Get the shutdown privilege for this process. AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0); // Cannot test the return value of AdjustTokenPrivileges. if (GetLastError() != ERROR_SUCCESS) return FALSE; // Shut down the system and force all applications to close. if (!ExitWindowsEx(flags | EWX_FORCE, 0)) return FALSE; return TRUE; } else { // Windows 95 etc if (!ExitWindowsEx(flags, 0)) return FALSE; return TRUE; } }
But if you mean to shut down the computer for a time and then let it start automatically I don't think it is possible. Not without some hardware.