console-application

how to get all IIS worker Processes list into my Console Application?

假如想象 提交于 2019-12-11 05:47:18
问题 i have a server in which i published a asp.net web site. i want to create a console application which show how many worker processes are in the IIS. please any help 回答1: You can add this reference in project Microsoft.Web.Administration assembly which can be installed using this nuget package or by adding a reference to this dll %WinDir%\System32\InetSrv\Microsoft.Web.Administration.dll using (ServerManager manager = new ServerManager()) { var requests = manager.ApplicationPools .SelectMany

Pinvoke. Speed up Console.Write();

旧城冷巷雨未停 提交于 2019-12-11 05:42:50
问题 I am writing a c# console tetris game. Once I got to the part that the application was ready. I got to the part where I had to solve lagging. I am writing out like this: static void writeCol(string a, ConsoleColor b) { ConsoleColor c = Console.ForegroundColor; Console.ForegroundColor = b; Console.Write(a); Console.ForegroundColor = c; } So when a new block comes/i want to move somehing: writeCol(blokk, ConsoleColor.Magenta); Where blokk is: private const string blokk = "█"; I have found a way

64bit Console app / ThreadPool out of memory

匆匆过客 提交于 2019-12-11 05:35:44
问题 I have an ASP.NET web app and it's using 5GB memory running on 64bit Windows 7 machine with 8GB memory without any problem. However, when I create a new C# console application on the same machine and reuse the same components the web app uses, the console app runs out of memory at about 1.6GB (by looking at System.Environment.WorkingSet and System.Diagnostics.Process.GetCurrentProcess().WorkingSet64). There are still plenty of physical memory left. It repros on 2 different machines. Both web

Showing WideString variable into console

。_饼干妹妹 提交于 2019-12-11 05:25:18
问题 I'm having problems showing a WideString into the console. I'm totally new on Builder C++ and C++ in general. Not sure if I need some headers or maybe the values shown when debugging could help. It seems that when doing wcout << s; it is showing the address instead of the "wchar array". Here it is my code: //--------------------------------------------------------------------------- #include <iostream.h> #include <vcl.h> #include <string> #include <wstring.h> #pragma hdrstop //---------------

How do I correctly exit/stop/dispose a console application in C#

南笙酒味 提交于 2019-12-11 04:38:46
问题 I noticed in my Task Manager I have several copies of this app - though not take any CPU resources. I know I must be doing something wrong, so I ask the collective... Here is the sterilized code using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Diagnostics; namespace AnalyticsAggregator { class Program { [STAThread] static void Main(string[] args) { try { bool onlyInstance = false; Mutex mutex = new Mutex(true,

copy directory files with progress bar

守給你的承諾、 提交于 2019-12-11 04:25:52
问题 Trying to create a console application to copy directories from the source to the destination and either the progress bar does nothing while files are copied ... My.Computer.FileSystem.CopyDirectory(source, destination) For i = 1 To 100 Console.Write(String.Format("Copy progress: {0}%" & vbCr, i)) Threading.Thread.Sleep(100) Next or the progress bar says "Copy Progress 1%" the entire time it's copying ... For i = 1 To 100 Console.Write(String.Format("Copy progress: {0}%" & vbCr, i)) My

How to make Visual Studio debug session launch a cmd.exe replacement?

断了今生、忘了曾经 提交于 2019-12-11 04:18:40
问题 Can I somehow setup visual studio to launch a cmd.exe replacement (on this case TCC/LE, from JP Software) console when debugging console applications? I have it setup on the Tools Menu as an External tool with a start directory pointing to the project debug bin folder. But I'd like a more immediate access, just so hitting the F5 key (Start Debugging) would launch the application in this cmd.exe replacement instead. 回答1: In the project properties for your console project select the debug tab.

C++, user input check for '\0' stops at spaces?

五迷三道 提交于 2019-12-11 04:09:07
问题 If the user inputs a sentence containing spaces the while loop stops at one of these spaces. Why is this happening? are '\0' and a space the same or did i do something else wrong? int main ( ) { char user_input[200]; cin>>user_input; int i=0; while(user_input[i]!='\0') { i++; } cout<<i; return 1; } Thanks everyone, I appreciate your help. 回答1: \0 is the null terminating character with ASCII code 0 . Space is another character with ASCII 32 i suppose. In fact you are doing this. cin >> user

Conversion from string “a” to type 'Boolean' is not valid

房东的猫 提交于 2019-12-11 04:07:17
问题 This one's really got me confused. I'm trying to do a visual basic console application that if the user enters 'A' or 'a' then the program should do 'x', but that's not working. The error I get is: Conversion from string "a" to type 'Boolean' is not valid. Here's my code: Module Module1 Sub Main() Dim Selection As String Console.WriteLine("Please select your function:") Console.WriteLine("* To convert binary to decimal, press A,") Console.WriteLine("* Or to convert decimal to binary, press B"

Hide C# Console App Window When Started by Task Scheduler

可紊 提交于 2019-12-11 03:30:05
问题 I have searched google for this and read some resources but I wasn't able to find a good answer. Does anyone know how to prevent the console app window from opening when it is started by the task scheduler? Ref. https://www.google.com/search?q=task+scheduler+hide+console+window&aq=f&oq=task+scheduler+hide+console+window&aqs=chrome.0.57j0l2j62.7404&sourceid=chrome&ie=UTF-8 回答1: Change the output type to Windows application will solve your problem Goto : Project - >Project Properties 回答2: Check