Questions tagged [console.writeline]

Writes the specified data, followed by the current line terminator, to the standard output stream.

Writes the specified data, followed by the current line terminator, to the standard output stream.

253 questions
-3
votes
2 answers

What is "4" doing in below code piece?

I understand {0} is the 1st argument as id, {1} is the second argument as sw.Elapsed.TotalMilliseconds but what is 4 for? Console.WriteLine("End counting {0} : {1, 4:N0} ms", id, sw.Elapsed.TotalMilliseconds);
Lyrk
  • 1,936
  • 4
  • 26
  • 48
-3
votes
1 answer

Cross-thread invalidOperationexception is thrown before invokeRequired is handled

I'm importing a json file and display its contents through Console.WriteLine to a textbox. I used multiple threading because I would like to cancel the writing of its contents and have read about that you need to Invoke the writing to a textbox when…
Efratror
  • 31
  • 1
  • 3
-3
votes
1 answer

Exception with int to string convert in WriteLine

Picture Exception on english: "Argument 1: cant convert "int" into "string". But in my parametrs and arguments I used only "int" type. How can I typed my parameters (X and Y) used WriteLine method?
Snobya_KNB
  • 35
  • 4
-3
votes
2 answers

C#: Large amounts of text cut off when read by program

Hi I cant seem to find any useful information regarding how to store information into an array from a console.writeline. Console.WriteLine("Please enter one or more sentences."); string text = Console.ReadLine(); How would I store the users…
L. Full
  • 440
  • 2
  • 5
  • 17
-3
votes
2 answers

How to write multiple things to console at once?

int a=10,b=20; console.writeline(a); console.writeline(b); I want to use only one console.writeline(); I use code below but doesn't work console.writeline(a,b);
Maasoud Asadi
  • 61
  • 4
  • 8
-3
votes
3 answers

C# simple "for" and "int" issue

Im trying to learn C# from scratch and I have issue with one simple task. I cant understand why this is Not working,can you please explain me : namespace ConsoleApplication1 { class intro { static void Main(string[] args) …
tslid
  • 315
  • 1
  • 4
  • 16
-3
votes
4 answers

c# for statement variable usage outside of the statement

for (i = 0; i < 14; i++) { //display data here } Console.WriteLine("{0}", i); Console.ReadLine(); I want to display the amount of times total i iterated outside the for statement so it only displays ONCE.
Dan
  • 185
  • 2
  • 2
  • 12
-4
votes
2 answers

c# Console.WriteLine();

In C#, after I write Console.WriteLine() and I'm asked to enter several values, can I get them all in one method? For example: double a, b, c = 0; Console.WriteLine("please enter the values of:\n a value:\n b value: \n c value:"); thanks for the…
-4
votes
1 answer

Cannot find Console.Writeline in Visual Studio

I'm using c# in visual studio 2017. I've written a Console.Writeline() somewhere within my application but I can't remember where I've written it. I'm wondering if there's a tool in visual studio that can help me find it. Can anyone help?
-4
votes
2 answers

Console.WriteLine not printing out

I have a class Insurance and InsuranceTest these classes are part of a bigger project with an entry point static void main(string[] args). It is refusing to execute this entry point and doesn't print out my results. INSURANCE CLASS namespace IT { …
asd afs
  • 3
  • 5
-4
votes
1 answer

How to use write line to print an integer value from another class?

I'm trying to output a changing integer value in main used and created in multiple other classes. For learning purposes I'm seeing if it's possible to do what I'm trying to do and see what's causing the errors. Here's the code: class Program { …
-5
votes
2 answers

how to write certain variables in a list to the console C#

Stylist stylist1 = new Stylist(); // creates new stylist stylist1.FirstName = "john"; stylist1.LastName = "smith"; stylist1.Phone = "123456789"; stylist1.Email = "js@123.456"; stylist1.Rate = "123"; Stylist stylist2 = new Stylist(); // creates new…
-6
votes
4 answers

How do I write characters to the console without line breaks?

string value = "test"; for (int i = 0; i < value.Length; i++) { Console.WriteLine(value[i]); } output of the program is: t e s t I want the output would be "test"
Badruzzaman
  • 41
  • 1
  • 7
1 2 3
16
17