console-application

Comments on binary addition program in visual basic

会有一股神秘感。 提交于 2019-12-25 07:34:24
问题 I've got code for a binary addition console application which basically adds up two added binary numbers. could someone either explain to me how it works or write comments with the code to show how each part works. P.S All i don't understand is the function Heres the code: Dim a As Integer = 8 Dim b As Integer = 2 Dim c As Integer = 10 Sub Main() Dim binary1 As Integer Dim binary2 As Integer Console.WriteLine("---------------------BINARY ADDITION---------------------") Console.WriteLine(

global variable in main not getting recognised in another function in python

瘦欲@ 提交于 2019-12-25 05:24:13
问题 code below creates a layout and displays some text in the layout. Next the layout is displayed on the console screen using raw display module from urwid library. However running the code fails as a global variable ui, declared in main, is not recognised in another function. Error code on running is : Traceback (most recent call last): File "./yamlUrwidUIPhase6.py", line 97, in <module> main() File "./yamlUrwidUIPhase6.py", line 90, in main form = FormDisplay() File "./yamlUrwidUIPhase6.py",

Close C# Console Application after MessageBox click

泪湿孤枕 提交于 2019-12-25 05:06:11
问题 I'm still learning all the cool tricks C# has to offer. I have a messagebox alert that pops up after a timer expires. I'm wondering if it is at all possible to have the console application terminate on its own after the user click the "OK" button on the messagebox. The console app is automatically minimized to the taskbar if that of any circumstance. Thanks in advance. 回答1: Give this a go: // Terminates this process and gives the underlying operating system the specified exit code.

Redirected batch file process output not running

蓝咒 提交于 2019-12-25 04:47:14
问题 I'm attempting to redirect output from a batch file execution to the main window of our console application. I'm calling the method to run the process like this: this.runProcess("\\bar\foo\blah\", "myBatch1.bat", "bat"); The method being called is as follows: public void runProcess(string aPath,string aName,string aFiletype) { Console.WriteLine(); Console.WriteLine(); Console.WriteLine("Started: {0}",DateTime.Now.ToString("dd-MMM hh:mm:ss")); Console.WriteLine("Will try run this file {0} {1}"

Azure Connection String - Object Reference not set to an Instance of an Object

≯℡__Kan透↙ 提交于 2019-12-25 03:34:21
问题 I'm trying to download azure blobs in a Windows Console Application. When I build and debug the application my azure connection string is throwing an exception. This string works fine in my other asp.net app. The offending line is: CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["DefaultEndpointsProtocol=https;AccountName=xxxxx;AccountKey=xxxxx==;BlobEndpoint=https://xxxxx.blob.core.windows.net/;TableEndpoint=https://xxxxx.table.core

basic currency converter, why doesn't it compile?

北战南征 提交于 2019-12-25 03:16:41
问题 Really new to programming so I hope this question isn't too annoying but I have hit a wall. I have to make a currency converter in c#, where there is 5 currencies with a stated value each. The console should ask thee user how much they want to convert, what they want to convert to and then display something like "you entered 25 EUR which converts to 27 USD double amount; double USD = 1.39; double GBP = .82; /*double CHF = 1.22; double AUD = 1.48; double CAD = 1.51;*/ string currency; Console

C console repainting stuttering/not fluid

本秂侑毒 提交于 2019-12-25 03:14:33
问题 I am trying to make a simple snake game on console. I am using an int matrix to store all the data (borders, snake, food to eat) at their exact location. I use this main code for now to run the program : int main() { int tab[28][120]; create(tab, 28, 120); paint(tab, 28, 120); char i = '1'; char direction = 'R'; while(i != 'q') { if (kbhit()) i =getch(); translate(tab, direction, 28, 120); paint(tab, 28, 120); Sleep(300); } } The main problem being, every time I repaint the matrix, it

how to keep a simple c# console app running after end of the application. [duplicate]

你离开我真会死。 提交于 2019-12-25 02:23:15
问题 This question already has answers here : How to stop C# console applications from closing automatically? [duplicate] (9 answers) Closed last year . I have a simple console tool which is written in c#. As soon as the user enters some data by typing and hitting enter key. My tool does it work and prints out some useful information for the user. Since user already hit the enter key, the console app windows is close even if I put Console.WriteLine(); So the user can't read the output information

Grouping up students records in a Binary File in C++ Based on their Batch Number?

倾然丶 夕夏残阳落幕 提交于 2019-12-24 21:42:00
问题 im working on a console application in C++ (I'm a beginner) and the purpose is to make a small application that can store, read and modify students records Now, i want to group up data of binary file (class9.dat) such that all the students with common batch id ( char type batch[5] ) should stuck together , by saying "stuck together", i mean if initially, consider binary file consider data in this form [Tom , 2] [Harry, 1] [Peter, 2] [Stephen, 1] [Henry , 0] then, after stucking data together

Entity Framework Core get context in console application

半城伤御伤魂 提交于 2019-12-24 21:04:35
问题 I have a Visual Studio 2017 solution with 3 projects. One class library that has DAL (.NET Standart 2.0), one AP.NET MVC Application (.NET Core 2.0) and the third Console Application (.NET Framework 4.6.1). I have referenced DAL in both of the projects. It has implemented Unit of Work pattern and uses Entity Framework Core. In ASP.NET MVC project I have configured to get context with Dependency Injection as follows services.AddDbContext<ApplicationDbContext>(options => { options.UseSqlServer