visual-c#-express-2010

Getting exe name of installed programs in C#?

扶醉桌前 提交于 2019-11-28 05:06:45
问题 i am using this to get the program names, but i need the exe names. How do i find them? string SoftwareKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products"; RegistryKey rk = default(RegistryKey); rk = Registry.LocalMachine.OpenSubKey(SoftwareKey); //string skname = null; string sname = string.Empty; foreach (string skname in rk.GetSubKeyNames()) { try { sname = Registry.LocalMachine.OpenSubKey(SoftwareKey).OpenSubKey(skname).OpenSubKey(

Running a .exe application from Windows Forms

帅比萌擦擦* 提交于 2019-11-28 00:28:03
问题 I have an application that I run on the command prompt as follows: C:\some_location> "myapplication.exe" headerfile.h I want to create a Windows Forms application where the user can specify the location of the executable and also the header file so that the Windows Forms application can do this for him/her, and the user wouldn't have to go to the command line and do it. How can I do this? 回答1: You need to use the Process class: Process.Start(@"C:\some_location\myapplication.exe"); For

Properly disposing of, and removing references to UserControls, to avoid memory leak

烂漫一生 提交于 2019-11-27 20:41:49
I'm developing a Windows Forms application (.NET 4.0) in c# using Visual c# express 2010. I'm having trouble freeing up memory allocated to UserControls I'm no-longer using. The problem: I have a FlowLayoutPanel, where custom UserControls are displayed. The FlowLayoutPanel displays search results and so on, so the collection of UserControls that are displayed must be repeatedly updated. Before every new set of these UserControls are created and displayed, Dispose() is called on all the Controls currently contained in my FlowLayoutPanel's ControlCollection (Controls property), then Clear() is

Change “Visual Studio 2010” folder location

妖精的绣舞 提交于 2019-11-27 11:48:44
问题 I would like to change the "Visual Studio 2010" folders location to my Dropbox folder, so it gets synced every time I make a change. I have searched on the internet, but haven't found a solution yet. Is it possible to change the "Visual Studio 2010" folders location from within Visual Studio 2010, specifically Visual C# Express 2010? 回答1: Tools > Options > Projects and Solutions > General > "Projects location" setting. Change the others too if you routinely create templates. 回答2: If you want

Getting Downloads Folder in C#? [duplicate]

牧云@^-^@ 提交于 2019-11-27 11:02:54
This question already has an answer here: How to programmatically derive windows downloads folder “%USERPROFILE%/Downloads”? 6 answers I have made some code that will search directories and display files in a listbox. DirectoryInfo dinfo2 = new DirectoryInfo(@"C:\Users\Hunter\Downloads"); FileInfo[] Files2 = dinfo2.GetFiles("*.sto"); foreach (FileInfo file2 in Files2) { listBox1.Items.Add(file2.Name); } I have even tried this: string path = Environment.SpecialFolder.UserProfile + @"\Downloads"; DirectoryInfo dinfo2 = new DirectoryInfo(Environment.SpecialFolder.UserProfile + path); FileInfo[]

How can I access embedded resources in a C# project?

╄→гoц情女王★ 提交于 2019-11-27 06:57:23
问题 Most of the threads I've read about this question answer that you just have to access them like this: <MyProjectNamespace>.Properties.Resources.<MyResourceName> But at the build process I have this message: <MyProjectNamespace> does not contain a definition for 'Properties' It seems that the class 'Properties' is normally auto-generated by the IDE when you add resources to your project. The fact is that I'm working on Eclipse and I don't really know how to add resources, but I managed to

Align Text in Combobox

删除回忆录丶 提交于 2019-11-27 05:46:08
问题 I want to align my text in combo box so that it will show in the center of combobox tell me how to do this also you can see there is a default border around a combo box when it is in focus how can i remove that border also Kindly solve my two problems Thanks 回答1: This isn't supported for ComboBox. The exact reasons are lost in the fog of time, ComboBox has been around since the early nineties, but surely has something to do with the awkwardness of getting the text in the textbox portion to

How do I fix an “Invalid license data. Reinstall is required.” error in Visual C# 2010 Express?

微笑、不失礼 提交于 2019-11-27 01:09:22
问题 I've tried to install Visual C# 2010 Express edition onto my PC, but whenever I try to run it, I get a error message. Invalid license data. Reinstall is required. I've already tried reinstalling it, and the message persists. OS is Vista Home Premium. I already have VC# 2008 Express installed. 回答1: This worked for me on Vista. It's based on work-around at MS: http://connect.microsoft.com/VisualStudio/feedback/details/520110/invalid-license-data-reinstall-is-required Download subinacl command

“A project with an Output type of Class Library cannot be started directly”

落爺英雄遲暮 提交于 2019-11-26 07:46:18
I'm a novice in C# and Visual C# IDE, I don't know anything about how to use them at all. I have programmed all my life in C on EclipseIDE. I have searched on several places how to solve this problem but could not get a proper procedure to do so. I'm posting the question here, for that reason. I downloaded a C# project , I wish to debug the project to see how an algorithm implementation works. The project has come in a Folder, inside this folder there are - .sln file and a folder which has - Source files and .csproj file . I installed Visual Studio C# Express and opened the .sln file present