Relative Content

Tag Archive for c#console-application

If FileName is blank or empty, delete it

I need help to figure how to delete a file when it does not have a filename, per example:
004249 and 004252 do not have a file name and I would like to delete them. I hope I have added all the things you will need to help me with this part of my code. Thank you.

How do I keep the console window open after running a C# program?

Problem Statement:
I’m learning C# and created a simple console application that prints ‘Hello World’. However, the console window closes immediately after running the program, and I can’t see the output. What is the best way to keep the console window open so I can view the output after running my C# program?

Call is Ambiguious for me but not my professor

I know there are similar questions but I don’t see one exactly like my issue. I have copied my professor’s code exactly (he was doing a walkthrough of one of the problems) and for some reason, his code works perfectly and mine crashes and tells me that “the call is ambiguous between the following methods or properties”. My code looks just like his…. what am I missing?

Its a good? I Cant start this. Console Application

namespace Kreta.Console.Model
{
public class AwardedStudent
{
public AwardedStudent(string name, int age, int award, bool isOneAward)
{
Name = name;
Age = age;
Award = award;
MonthlyPayment = isOneAward;
SchoolClass = string.Empty;
}