Hot answers tagged c#
No, the OS and CPU will decide what to run and when. in the simple example you have shown, to the exclusion of other tasks, yes those would most likely run in parallel on separate cores, but there is rarely a guarantee that that will be the case. You can use the thread affinity to attempt to take some control over the allocation of a core to a given ...
You cannot guarantee in .Net that two Threads run on two separate cores. In fact, you also cannot guarantee that one Thread will run on only one core(!). This is because managed threads are not the same as OS threads - a single managed Thread may use multiple OS threads to support it. In C#, you only ever deal directly with managed Threads (at least, ...
Download and install the latest .NET Framework. For example, you can use the installer for the .NET Framework 4.5 installer. Open a command prompt and change into the installation directory of the .NET Framework. For example: cd \Windows\Microsoft.NET\Framework\v4* Use MSBuild.exe to compile your solution. For example: msbuild ...
You can't make it toggle without going into either a macro or other VS extension. However, I always setup VS to comment with Ctrl + / and uncomment to Ctrl + Shift + / You can customize the keyboard shortcuts by going int the "Tools" menu and selecting "Options". Then select "Keyboard" from the "Environment" branch. From there you can bind the ...
If you have ReSharper installed (and using VS without it is/was tedious), you can assign a single key to the command ReSharper.ReSharper_LineComment. For instance, I bind the keyboard shortcut Ctrl-K, Ctrl-C to the command, and then if I use it on a line that is uncommented, it comments it, and if the line is commented, it will uncomment it.
I believe it stems from home users that may have a "family PC". Kids don't want "Family Tree Maker" and parents don't want "Spongebob Squarepants - the Video Game" on their respective start menus.
"Just for me" should mean that the application installs into a user directory and only creates shortcuts for the current user. This could be useful e.g. when the user does not have admin rights (and therefore can't write into %PROGRAMFILES%, HKEY_LOCAL_MACHINE, and other interesting places). If you force "install for everybody", you may be limiting the ...
Word does not natively support syntax highlighting, or other code formatting. As such, it is best to create the highlighting etc in a different program (visual studio, eclipse, notepad++, or this website which can do 14 languages and requires no install). When pasting the text however, doing it directly in the word document itself can lead to headaches like ...
Technically, there is no way to prevent something that has already happened, unless you have a time machine. Your question stated that you believe your program has been compromised (past perfect tense) -- this is an action which has already occurred. Preventing an action which has already occurred would involve time travel, because there is no other way that ...
Well, I think the answer depends on how the application you're installing has been developed. Does it correctly place all user-created data into appropriate folders under a user's profile, or is it designed to run universally (and store user-created data in a common folder structure such as all users)? Does it rely on registry keys in a user's profile ...
Using Scheduled Tasks To open Scheduled Tasks -> click Start -> click All Programs -> point to Accessories -> point to System Tools -> click Scheduled Tasks. To schedule a new task: 1. Double-click Add Scheduled Task to start the Scheduled Task Wizard, and then click Next in the first dialog box. 2. The next dialog box displays a list of ...
If the machines are this grossly under-powered then I'd make the argument to your superiors that the problems lie in the companies IT provision to staff. I'd say any development time spent on this would be ill-spent.
\b means "word boundary" outside of character classes (also called character sets) and "backspace" inside character classes. Here it means a word boundary: \bhello\b Here it means a backspace [\b] See this Microsoft reference: Character Escapes in Regular Expressions. PERL regex has the same definition for \b.
I would go for ClickOnce. Basically you right click on your project in visual studio and choose publish. You get a simple web-based installer, a start menu shortcut on your clients and an autoupdate feature.
Write the program as a Windows service, instead of an application.
As Vitomakes stated on his answer, you need a Microsoft Account and it is free, mine worked as well. I would recomend registering a new account (same screen has a register option) if yours doesn't work for some reason so you can continue using the product. The upper right corner of Visual Studio will show the current account details once you are logged in. ...
It will likely depend on your audience - and in particular, how many of your users are users of mobile internet. I've found that my IP address on 3G networks changes very often, even though my home IP address doesn't. You should also take into account users who will access your site (I'm assuming you're creating a web site; you've given us no context) from ...
Maybe a bit naive, but still... format & reinstal Windows :-)
Visual Studio is orientated around projects, so you'd need to add your cs file to a new (empty) project, before you can compile it through Visual Studio.
Ultimately the answer is: there is no such system. Since the user—owner and administrator—of the computer has full control they can fake anything (with sufficient effort) up to and including any attempts by your software to call home for verification. Remember they can always modify your software (including eliminating checks against such modification) as ...
Launching a process when the shutdown was initiated is a bad idea. At this stage the most likely outcome is to get back the error 1115 ERROR_SHUTDOWN_IN_PROGRESS. A much better way is to install a service and register the service to receive shutdown notifications via RegisterServiceCtrlHandlerEx, see shutting down: Service applications receive shutdown ...
Here is another solution in the link below: (Creating a Console App in Visual Studio Express 2012 for Web) http://possiblythemostboringblogever.blogspot.com.au/2012/08/creating-console-app-in-visual-studio.html The main point is like: I've installed and am using Visual Studio Express 2012 for Web as my primary IDE for C#. There isn't a template for a ...
It might be different in your version, but it should be in the same place:
Windows Remote Shell is what you want; http://technet.microsoft.com/en-us/library/dd163506.aspx Once setup, you can go WinRS -r:MYSERVER "cmd.exe" which will run cmd.exe on the remote machine and bring you a remoted console session locally. Alternatively, you could just run any other command directly on the box instead. Actually, if you are need to use ...
Issues like this is why we use OSs, it provides a layer of abstraction so you do not need to concern yourself at the application level about things like how the memory is stored on the hardware level. The layers are similar to this (for HDD drives), Each layer shows next to it who is responsible for that layer. File (File system) | ...
Try to use any recovery tool (isn't important that it is cs file). and you have to use external subversion control next time. I've been using xp-dev.com. It has free plan. Try to google and you will find out more services like this. EDIT: There mentioned about code decompile - it is good idea. Try to use ILSpy - open source tool.
Although the proper answer is probably to use WinSCP and their C# library, I did find a way to get PSCP to work when the target folder has a space in it. The correct answer is to do this: pscp.exe -pw MyPassword firstname.lastname@example.org:/etc/myfolder/myfile.opt "C:\download files" It turns out that I was having another problem that was making me think the above ...
Like Bob commented: you need desktop version: http://www.microsoft.com/visualstudio/eng/downloads#d-2012-express Here are listed all versions. For some reason, Windows 8 means tiles for microsoft. You can create desktop applications, which work on the "metro" environment on a normal PC, with that "... for windows 8" version.
Only top voted, non community-wiki answers of a minimum length are eligible