windows-7

Environment.SpecialFolder.ProgramFiles value for a 32-bit application on Windows 7?

本小妞迷上赌 提交于 2019-12-22 08:04:12
问题 What would a 32-bit application running on Windows 7 return for the below? Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) C:\Program Files (x86) or C:\Program Files ? 回答1: On 32 bit Windows 7 you should get "C:\Program Files", on 64 bit "C:\Program Files (x86)". 回答2: It doesn't matter what it returns. Either value will map to the same folder, file system virtualization will always map it to (x86) for a 32-bit app. 回答3: Well I'm running Windows 7 Ultimate 32 bit so I wanted

How can I write a batch file to toggle my network adapters?

。_饼干妹妹 提交于 2019-12-22 06:32:03
问题 At my work, there is a company intranet I can connect to, as well as a Wifi network. But, it is company policy that we cannot connect to both networks simultaneously on one machine. I need to use either network at different times though, and the only way I've been able to do so is by going to "Change Adapter Settings" somewhere in the Network section of Control Panel, then disabling whichever adapter I'm using (either local area network or wifi) and enabling the other one. As a programmer the

ofstream doesn't work on Windows 7 hidden file

情到浓时终转凉″ 提交于 2019-12-22 06:07:13
问题 I realize that ofstream doesn't work on Windows 7 hidden file. Here is the quick test code. #include <fstream> #include <iostream> #include <tchar.h> #include <windows.h> int main() { { std::ifstream file2(_T("c:\\a.txt")); if (file2.is_open()) { std::cout << "ifstream open" << std::endl; } else { std::cout << "ifstream not open!" << std::endl; } } // SetFileAttributes(_T("c:\\a.txt"), FILE_ATTRIBUTE_NORMAL); SetFileAttributes(_T("c:\\a.txt"), FILE_ATTRIBUTE_HIDDEN); { std::ofstream file(_T(

ofstream doesn't work on Windows 7 hidden file

柔情痞子 提交于 2019-12-22 06:07:09
问题 I realize that ofstream doesn't work on Windows 7 hidden file. Here is the quick test code. #include <fstream> #include <iostream> #include <tchar.h> #include <windows.h> int main() { { std::ifstream file2(_T("c:\\a.txt")); if (file2.is_open()) { std::cout << "ifstream open" << std::endl; } else { std::cout << "ifstream not open!" << std::endl; } } // SetFileAttributes(_T("c:\\a.txt"), FILE_ATTRIBUTE_NORMAL); SetFileAttributes(_T("c:\\a.txt"), FILE_ATTRIBUTE_HIDDEN); { std::ofstream file(_T(

visual studio 2010: the application data folder for visual studio cannot be created

不羁岁月 提交于 2019-12-22 06:00:29
问题 I just installed visual studio 2010 on my win7 32 bit computer and i get the following message when I start it: "the application data folder for visual studio cannot be created" I had this same version of visual studio on my xp sp3 computer and it worked fine. I googled for various solutions but nothing worked. I tried to run: "%programfiles%\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /setup and to edit the [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User

convert python programme to windows executable

纵饮孤独 提交于 2019-12-22 05:45:16
问题 i m trying to create windows executable from python program which has GUI . i m using following script from distutils.core import setup import py2exe setup(console=['gui.py']) it gives following error Warning (from warnings module): File "C:\Python27\lib\distutils\dist.py", line 267 warnings.warn(msg) UserWarning: Unknown distribution option: 'console' Traceback (most recent call last): File "E:\my python\py2exe.py", line 3, in <module> import py2exe File "E:\my python\py2exe.py", line 5, in

Pin this program to taskbar option missing in my C# application

我们两清 提交于 2019-12-22 05:18:14
问题 All programs I have tried so far in Windows 7 have a 'Pin this program to taskbar' item when right-clicking them in the task bar. I have a C# program that only shows 'Close Window' and nothing else. It is build with C# 2010 Express, and targets .NET 3.5 framework. I can't find any reason why no other options show up or any properties I could change. Does anyone know what property could affect this option? 回答1: http://www.west-wind.com/weblog/posts/2009/Oct/08/Application-that-wont-Pin-to

Check if display is turned off by windows power management

故事扮演 提交于 2019-12-22 04:48:34
问题 How can I programmatically check in Windows 7 and XP if 'windows power management' has turned off the display? (If I can receive an event, that would be even better.) 回答1: I don't think it can be done for XP. In Windows 7 there are all kinds of goodies related to power management. The Windows API Code Pack is a set of managed wrappers that are simple to call from C# or VB and that map Windows paradigms (like event sinks, Windows messages and function pointers) into .NET ones (like delegates

IIS_IUSRS group is not found in Windows 7 laptop

删除回忆录丶 提交于 2019-12-22 04:43:31
问题 I have 500 error when debug an asp.net application on my Windows 7 laptop. It looks like a permission problem. Therefore I want to give the permission to the corresponding folder. I tried to add IIS_IUSRS to the group. But I can't add it because it doesn't exist. See the image below please. EDIT: I checked the user groups. It is there 回答1: IIS_USRS is local group added with IIS 7 release. It isn't available on active directory so while searching it location should be selected as local machine

Windows 7 x64 COM/Serial port Sniffer/Redirect

本秂侑毒 提交于 2019-12-22 04:42:39
问题 I need to know what's happening between my computer and a USB Virtual COM port device in order to understand if all of the bytes are being well transmited. I use a Java application to interact with the device and I want to have a native app that allow me to see the exchanged frames (both ways), but I can't find any software for that in Windows 7 x64. Is there any software to sniff ir just redirect a COM port received and trnasmitted messages? 来源: https://stackoverflow.com/questions/9213733