C# is a multiparadigm, managed, garbage-collected object-oriented programming language created by Microsoft in parallel with the .NET platform

learn more… | top users | synonyms

25
votes
5answers
25k views

How do I add formatted code to a Microsoft Word document?

I need to write a document in MS-Word 2007 that contains a lot of examples of VB.NET and C# code. What is the best way of getting the code to look reasonable in the document? What styles etc do ...
16
votes
2answers
3k views

When you start multiple threads on a multi core processor, are they guaranteed to be processed by different cores?

I have a Pentium core i5 processor, which has 4 cores. If I do this in a C# console program var t1 = new Thread(Thread1); var t2 = new Thread(Thread2); t1.Start(); t2.Start(); are t1 and t2 threads ...
9
votes
8answers
3k views

Why install for “just me” as opposed to “everybody”?

I'm using windows installer for a client's app, and they are complaining that sometimes multiple instances of an app appear on the computers they are using for testing. This problem has gone away ...
9
votes
2answers
4k views

How to make CTRL + / toggle a comment in Visual Studio

How can I make CTRL + / toggle a comment in Visual Studio, as it does with XCode and Eclipse?
7
votes
2answers
3k views

How can I compile a .NET project without having Visual Studio installed?

I want to compile a .NET/C# project, but I don't want to install Visual Studio to do this. What tools do I need and how can I compile the project?
7
votes
1answer
156 views

Meaning of \b in .Net Regular Expressions [closed]

Microsoft has a nifty quick reference card for .Net Regular Expressions. But it seems to list \b as both matching Backspace and also matching "On word boundary". Which is it? Can \b really do both? ...
5
votes
4answers
884 views

Shortcuts to exe on network pc ok?

I created a simple calculator in C# for work. It's just one executable file. I was thinking of putting a single copy of it on a network drive and send everyone a shortcut to it to access it. I'm new ...
5
votes
4answers
8k views

Where is the MachineKeys folder in Windows 7?

I know where the MachineKeys folder in XP. Anybody can tell me where it is in Windows 7?
5
votes
3answers
508 views

On windows, connect to a Virtual PV VM running Ubuntu for things like memcached, etc

I am on Windows 7, building an ASP.net web application. There are a few services that I need to connect to, and don't want to go through the hassle of installing them on Windows. I also run ...
4
votes
2answers
254 views

“Stream” an app?

Is there a way to "stream" an application on windows? This might not be the right place to ask this, but, is there a way to, say, stream something like Avast from one computer to another, and then ...
4
votes
2answers
1k views

How to launch the Windows Explorer shell after starting with a different one?

The following is a hack, but for what I need it for its fine... I created a C# program that shows some EULA text and has an Agree and Disagree button. I set the ...
4
votes
1answer
631 views

Microsoft Visual C# 2010 Express error loading Silverlight

What's going on?: After selecting Silverlight Navigation with Accent Color from Online Templates in Microsoft Visual Studio C# 2010 Express, I am receiving the following error message. Error: ...
4
votes
1answer
719 views

Can window snap be programmatically rotated when monitor is rotated to portrait?

My secondary monitor, which normally uses 1680x1050 resolution, is rotated (physically & through Windows) to be displayed vertically (1050x1680). Is it possible, programmatically or via ...
3
votes
10answers
409 views

Warm-up .NET application

We have speed problems in corporate enviroment. Most of the notebooks are strongly loaded: the start-up time of Excel is 3-5 minutes, Outlook 10-15 minutes etc. Our application has the same start-up ...
3
votes
4answers
2k views

How often do users change their IP address (average time needed)?

Basically, i need to know how long (on average) and ip address is used per user, this can be US-only stats or World-Wide stats, if you have a source please state it. If its your own data please let us ...
3
votes
3answers
1k views

Mapping a https://… as a local logic drive?

I can map a network share point to a local logical drive by using net.exe like this: net use J: \\cnf001\test\folder1 /user: ... I build a C# lib to use Process to simulate the mapping. Now I have ...
3
votes
1answer
652 views

How do I find the applications that require the .NET framework?

Is there a way to look at all the applications installed on a users computer and determine which, if any, are utilizing the .NET framework? My problem is that I want to upgrade our users computers ...
3
votes
1answer
276 views

Why doesn't Firefox trigger UAC notification on Windows 7?

I have a C# (WPF) application (my own creation) that needs to open a port on the computer. This means that it requires administrative privileges to run. The app is currently unsigned and every time I ...
3
votes
1answer
2k views

TrueCrypt drive letter not available

With c# or a batch file I mount a trueCrypt volume located at A:\volumeTrueCrypt.tc With c# I do: static void Main(string[] args) { var p = Process.Start( fileName:@"C:\Program ...
3
votes
4answers
955 views

connect to two networks from one computer simultaneously

I have two very separate networks that I'd like to monitor with one computer. I am working on creating a simple windows form app that monitors the availability of each network by pinging a server ...
2
votes
3answers
6k views

What is the best way to run a Console Application once per day at a certain time?

What is the best way to run a Console application (C#) once per day at a certain time on Windows XP? I want to see the Console window.
2
votes
2answers
4k views

Command line RDP call CMD on target machine

I need to remote into ~50 machines and run a batch file. Is there any way I can start up an RDP session and call cmd?
2
votes
4answers
473 views

uTorrent automatic scheduling program

I am using utorrent on a mini "home utorrent server" full time. And when I go to bed, I have to manually set up the bandwith limit to max. And in the morning, I have to set it up to, say, 60% of the ...
2
votes
2answers
2k views

C# lost local variable window from debug (f11 step by step)

I was running my code (visual studio 2010) and I accidentally closed the window that shows the state of variables step by step. I think it was called locals but I can't find it on any of the menu ...
2
votes
1answer
348 views

C# windows 7 run exe before computer shutdown

I want to run an executable that saves an XML file on a local drive before the computer (running on Windows 7) gets shut down. I know it is possible to run scripts before shutdown. This can be ...
2
votes
4answers
3k views

Install Visual Studio on Cloud computer?

Is there any know cloud computer solutions out there that lets me install development software like C# Visual Studio 2008? im looking for a solution that lets me log in from both work, home or at a ...
2
votes
3answers
1k views

C# Code Editor which does not require Admin Privileges to Install [closed]

I am a Support Engineer interested in learning Programming. I have borrowed a few books from Library to learn C#, however, my office PC does not have admin privileges. Is there any code editor for C# ...
2
votes
2answers
315 views

Recover Visual C# 2010 Project

I have spent a lot of time writing a project in Microsoft Visual C# 2010 Express. While creating it i used multiple computers and opted to store the files on a external hard drive. While finishing my ...
2
votes
3answers
1k views

How can I password protect shortcuts on the desktop? [closed]

I wish to password protect specific programs before they are executed. For instance, I have just downloaded Google Chrome, and have a shortcut for it on my desktop. I am wondering if it is possible ...
2
votes
2answers
1k views

Visual C# - Program Will Not Run

I made a program with Visual Studio 2010. It required .NET Framework 4.0 to run, and the machine it needs to run on is not connected to the internet, so I found the redistributable online on my own ...
2
votes
2answers
795 views

I'm sick of manually copying my project folder to my DropBox folder. Please SO Jedi's, teach me the ways of the GIT?

I'm working on a personal project. Not very big and I'm the only one working on it. What is the basic way to have GIT save my working project to backup? How does GIT check if it's a working version, ...
2
votes
2answers
734 views

Disable Dropbox when WiFi isn't available

I have an ultralight PC with Windows 7 that I use during my daily bus commute. Since the processor speed is limited, I'm looking for a way to disable/enable Dropbox when I'm not connected to a WiFi ...
2
votes
2answers
1k views

Visual Studio 2010 haunted keyboard

It seems the haunted keyboard is back in VS2010 ... after working on a web application for a short while I find that some keys just don't work, or are behaving like certain keys are stuck. This is ...
2
votes
2answers
29 views

Searching major search engines with text such as <%#

If I type '<%# vs <%"' into any of the major search engines, everything is stripped out except the 'vs'. I understand why they do this. I would just like to know if anyone knows of a way to ...
2
votes
1answer
1k views

Is there any program (or code, any language) that will mute all of the microphones on my computer?

Is there any program (or code, any language) that will mute all of the microphones on my computer? If it is code, please make it as simple as possible, the only language I know is C# and I am still ...
2
votes
0answers
133 views

WinRT C# SVN Client

I try to connect SVN repo from Surface. And I realized that there are no apps for this. I want to write some one, but it's too complex to write my own SVN lib. Are there some lib for WinRT ARM ...
2
votes
0answers
130 views

Microsoft security update KB2656351 prevents output caching

I am working with .Net framework 4 and cookies are used in my application. Due to Microsoft security update KB2656351, output caching does not work. I can not remove cookies. If I remove the above ...
2
votes
0answers
479 views

runas verb not working in windows 8?

I am using some applications need to do some thing as an admin, so I was using the verb "runas" in windows 7 and it is working well, However, once we migrate to windows 8, the new processes were ...
2
votes
1answer
815 views

UDP Hole Punching impossible with non-well-behaved NATs?

Normally a NAT will keep the public end point of a local end point the same for all packets that are coming from it, thus making UDP hole punching easily possible. However, some NATs will map the ...
2
votes
2answers
336 views

How to associate a SATA HBA to a Physical Disk

I am, admittedly, very new to the whole WMI "thing". This "thing" is quite overwhelming and I'm not finding an answer to the question that I have at this point. I've found the best information for ...
2
votes
0answers
425 views

Microsoft ClickOnce Deployment with SFTP possible ?

I know that we could use FTP, Remote Website and Desktop to deploy our applications. I would like to know if anyone could suggest how to use SFTP instead? Are there any plugins that exist for this?
2
votes
0answers
482 views

Proxy software for all outgoing connection

I am working in an office, as our private requirements, we need to make all connection to specific domains must be sent via a proxy server. This is my issue for now, does anyone know a solution for ...
1
vote
3answers
7k views

Can I make C# Console applications on Visual Studio 2012 Express for Windows 8?

As the question, can I make C# console applications on Visual Studio 2012 Express for Windows 8? I am aware that you can create Windows 8 apps but is there a template to create C# based console ...
1
vote
6answers
7k views

How to recover my source code?

after a system crash down, one of my .cs file get lost. The size of the file is 18KB, when I tried to open it in VS2010, vs2010 auto opens it in NotePad, but the content is empty. I tried to open it ...
1
vote
2answers
775 views

Visual Studio Compile standalone C# file

I have a c# file, I opened it in VS2010, and I want to compile it now. Is it possible? I know I can compile it using C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe, but I do not want this. I ...
1
vote
3answers
396 views

Best way to export an icon from photoshop? [closed]

I'm writing a program to notify me of new email. It's mostly complete, I'm just working on the notifyicon code now. It's supposed to display the usual application icon with a box containing the count ...
1
vote
2answers
1k views

How to programmaticaly generate icon overlays?

See the small blue icon overlay? Is there a way that I can generate this type of items programmaticaly? I'd also like to know what these particular overlays mean.
1
vote
1answer
250 views

C# 5 Language Specifiction in LibreOffice Writer

I've faced with very weird behavior of LibreOffice when opening C# Language Specification version 5.0 in it. When I open this specification in Microsoft Word 2013 on the title page it's written "C# ...
1
vote
2answers
3k views

How to get curly braces autocompletion in Visual Studio 2012. C #

In moste IDEs you can set so if you type for example> if(isTrue) { //and when you hit enter here you get the } automatically But I have not found where you get this behavior in VS Options. Is there ...
1
vote
1answer
231 views

How to open a document multiple times in VS2012?

I would like to know if it is possible to open a source file multiple times in VS2012 Express? For example I would like to open a UserControl in two views (Code/Design) in two tabs to e.g. put each ...