This document provides an overview and list of C# tutorials, including introductions to C# code, system members, arrays, enums, value types, constructors, static keywords, inheritance, polymorphism, interfaces, delegates, events, multithreading, and networking. It also discusses using the C# compiler and command line arguments. The tutorials cover basic C# syntax and programming concepts.
OverBlog top European blogging platform chose Symfony 2 for its brand new version.
Lear about their engineers feedbacks on how they design their software architecture based on Symfony 2.
The following points will be discussed:
- Dependency injection: Making a high speed transport layer with Apache Thrift into Symfony 2.
- Security Bundle: Integrating a Single Sign On
- Twig: Using Twig sandbox to jail custom OverBlog's users themes integration.
This presentation will be animated by Xavier HAUSHERR (CTO) and Gérald LONLAS (Project manager)
With PHP 7.2 recently released and PHP 5.3 and 5.4 still accounting for over 40% of all production environments, it's time to paint a clear picture on not just why everyone should move to 7.0 (or preferably 7.1), but on how to get code ready for the latest version of PHP.
Using the version compatibility checker for PHP_CodeSniffer and a few simple step-by-step instructions, upgrading old code to make it compatible with the latest PHP versions becomes actually really easy. In this talk, we'll migrate an old piece of code and get rid of the demons of the past and ready for the present and future.
With PHP 8.0 recently released and PHP 5.x still accounting for over 40% of all production environments, it's time to paint a clear picture on not just why everyone should move to 8.x, but on how to get code ready for the latest version of PHP. In this talk, we'll look at some handy tools and techniques to ease the migration.
OverBlog top European blogging platform chose Symfony 2 for its brand new version.
Lear about their engineers feedbacks on how they design their software architecture based on Symfony 2.
The following points will be discussed:
- Dependency injection: Making a high speed transport layer with Apache Thrift into Symfony 2.
- Security Bundle: Integrating a Single Sign On
- Twig: Using Twig sandbox to jail custom OverBlog's users themes integration.
This presentation will be animated by Xavier HAUSHERR (CTO) and Gérald LONLAS (Project manager)
With PHP 7.2 recently released and PHP 5.3 and 5.4 still accounting for over 40% of all production environments, it's time to paint a clear picture on not just why everyone should move to 7.0 (or preferably 7.1), but on how to get code ready for the latest version of PHP.
Using the version compatibility checker for PHP_CodeSniffer and a few simple step-by-step instructions, upgrading old code to make it compatible with the latest PHP versions becomes actually really easy. In this talk, we'll migrate an old piece of code and get rid of the demons of the past and ready for the present and future.
With PHP 8.0 recently released and PHP 5.x still accounting for over 40% of all production environments, it's time to paint a clear picture on not just why everyone should move to 8.x, but on how to get code ready for the latest version of PHP. In this talk, we'll look at some handy tools and techniques to ease the migration.
Stormpath .NET Developer Evangelist, Nate Barbettini, presents Token Authentication with ASP.NET Core. Nate will explain how Token Authentication can be used to secure web applications built with ASP.NET Core, REST APIs, and 'unsafe' clients while supporting security best practices and even improving performance and scale.
For More :
https://www.facebook.com/Computer-Programming-Assignments-826290177441561/
-
https://www.facebook.com/A-Tech-and-Software-Development-1683037138630673/
asp.net using c# notes sem 5 ( we-it tutorials ).
Review of .NET frameworks, Introduction to C#, Variables and expressions, flow controls, functions, debugging and error handling, OOPs with C#, Defining classes and class members.
Assembly, Components of Assembly, Private and Shared Assembly, Garbage Collector, JIT compiler. Namespaces Collections, Delegates and Events. Introduction to ASP.NET 4: Microsoft.NET framework, ASP.NET lifecycle. CSS: Need of CSS, Introduction to CSS, Working with CSS with visual developer.
ASP.NET server controls: Introduction, How to work with button controls, Textboxes, Labels, checkboxes and radio buttons, list controls and other web server controls, web.config and global.asax files. Programming ASP.NET web pages: Introduction, data types and variables, statements, organizing code, object oriented basics.
Validation Control: Introduction, basic validation controls, validation techniques, using advanced validation controls. State Management: Using view state, using session state, using application state, using cookies and URL encoding. Master Pages: Creating master pages, content pages, nesting master pages, accessing master page controls from a content page. Navigation: Introduction to use the site navigation, using site navigation controls.
Databases: Introduction, using SQL data sources, GridView Control, DetailsView and FormView Controls, ListView and DataPager controls, Using object datasources. ASP.NET Security: Authentication, Authorization, Impersonation, ASP.NET provider model
LINQ: Operators, implementations, LINQ to objects,XML,ADO.NET, Query Syntax. ASP.NET Ajax: Introducing AJAX, Working of AJAX, Using ASP.NET AJAX
server controls. JQuery: Introduction to JQuery, JQuery UI Library, Working of JQuery
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0Antonio Chagoury
This is the slide deck for my "A Sneak Peek at Visual Studio 2010 and .NET Framework 4.0" presentation I gave at the CapArea.NET user group on December 15th, 2009 where we had upwards of 70 attendees.
Advantages of .NET over the other languages, overview of .NET binaries, Intermediate Language, metadata, .NET Namespaces, Common Language runtime, common type system, common Language Specification.
C# fundamentals – C# class, object, string formatting, Types, scope, constants, C# iteration, control flow, operators, array, string, Enumerations, structures, custom Namespaces
What is Computer Programming?
What is Software Development and Its Major Activities
Your First C# Program
Formatting the Program Source Code
The C# Language and .NET Framework
Microsoft Visual Studio: Compiling, Running and Debugging C# Programs
MSDN Library – The Integrated Help System in Visual Studio
Exercises: Creating, Compiling and Running C# Programs
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
C# tutorial
1. bogotobogo
Bogotobogo
contact@bogotobogo.com
Home | Sitemap | Contact Us
Home | About Us | Products | Our Services | Contact Us
Gif |JavaApplet/Web
Start | Flash | ShockWave | SVG | iPhone/iPad | Android | HTML5 |Algorithms | News | C++ | Java | PHP
| Design Patterns | Python | C# | Forums
Search
Introduction
List of C# 4.0 Tutorials
.NET Framework
Introduction - My First C# Code
System Members and Data
Modifiers
Array
2. Enumeration (Enums)
Value and Reference Types
Constructor and this Keyword
static Keyword
Encapsulation Services
Inheritance
Inheritance II
Polymorphism
Interfaces
Delegates
System.Object
Events
Multi Threading I - Introduction and Simple Thread
Multi Threading II - ThreadStart/ParameterizedThreadStart,
Foreground/Background Threads
Multi Threading III - Concurrency, Synchronization
Networking I - PORT, IPv4/IPv6, TCP/UDP, URI
Networking II - WebRequest/WebResponse, WebClient
Introduction
C# is a multi-paradigm programming language encompassing imperative,
declarative, functional, generic, object-oriented, and component-oriented programming
disciplines.
It was developed by Microsoft within the .NET initiative and later approved as a
standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270). C# is one of the
programming languages designed for the Common Language Infrastructure (CLI).
C# is intended to be a simple, modern, general-purpose, object-oriented programming
language. Its development team is led by Anders Hejlsberg. The most recent version
is C# 4.0, which was released on April 12, 2010.
3. What's new in C# 4.0
C# 4.0 is the latest version, which was released in April 11, 2010. Microsoft has
released the 4.0 runtime and development environment Visual Studio 2010. The major
focus of C# 4.0 is interoperability with partially or fully dynamically typed languages
and frameworks, such as the Dynamic Language Runtime and COM.
Your Ad Here
Here are new features:
Dynamic member lookup
A new pseudo-type dynamic is introduced into the C# type system. It is treated
as System.Object, but in addition, any member access (method call, field,
property, or indexer access, or a delegate invocation) or application of an
operator on a value of such type is permitted without any type checking, and its
resolution is postponed until run-time. This is known asDuck typing.
Covariant and contravariant generic type parameters
Generic interfaces and delegates can have their type parameters marked
as covariant or contravariant, using keywords out and in, respectively.
These declarations are then respected for type conversions, both implicit and
explicit, and both compile-time and run-time.
Optional ref Keyword when using COM
The ref keyword for callers of methods is now optional when calling into methods
supplied by COM interfaces.
Optional parameters and named arguments
C# 4.0 introduces optional parameters with default values as seen in Visual Basic
and C++.
4. Indexed properties
Indexed properties (and default properties) of COM objects are now recognized,
but C# objects still do not support them.
Visual Studio Command Prompt
You can invoke the C# compiler by typing the name of its executable file, csc.exe on
the command line. If you use the Visual Studio Command Prompt (available as a
shortcut on the start menu under Visual Studio Tools), all the necessary environment
variables are set for you. Otherwise, you must adjust your path in order to
enable csc.exe to be invoked from any subdirectory on your computer. If you do not
use the Visual Studio Command Prompt, you must
run vsvars32.bat under C:Program Files (x86)Microsoft Visual Studio
10.0Common7Tools to set the appropriate environment variables to support
command line builds.
Let's start with Visual Studio 2010:
Start -> Programs -> Visual Studio 2010 -> Visual Studio Tools.
Then, type in
csc -?
We get:
5. If we want to make it work on other command prompt, we should set the new path.
For my system the paths are:
C:WindowsMicrosoft.NETFramework64v4.0.30319
C:Program Files (x86)Microsoft SDKsWindowsv7.0ABin
C:Program Files (x86)Microsoft Visual Studio 10.0SDKv3.5Bin
Once you have updated your Path variable, close all dialog boxes and any currently
opened Console windows to commit the settings. You should now be able to execute
csc.exe and other .NET tools from any Command prompt. To test, enter the following
commands:
csc -?
ildasm -?
We can check it's working if we see the same output as the one running from the Visual
Studio Prompt.
Simple Command Line C#
Option Description
This option is used to specify the name of the assembly to be created. By
/out
default, the assembly name is the same as the name of the initial input *.cs file.
This option is used to specify the name of the assembly to be created. By
/target:exe
default, the assembly name is the same as the name of the initial input *.cs file.
/target:library This option builds a single-file *.dll assembly
/target:module This option builds a module. Modules are elements of multifile assemblies.
Although we are free to build graphical user interface-based applications using
/target:winexe
the target:exe. Modules are elements of multifile assemblies.
Compiles File.cs producing File.exe
csc /target:exeFile.cs
Compiles File.cs using abbreviation producing File.exe
csc /t:exeFile.cs
6. Compiles File.cs producing File.exe because /t:exe is the default output.
cscFile.cs
Compiles File.cs producing File.dll
csc /target:libraryFile.cs
Compiles File.cs and creates MyCSharp.exe:
csc /out:MyCSharp.exe File.cs
Compiles all the C# files in the current directory, with optimizations on and
defines the DEBUG symbol. The output is File2.exe
csc /define:DEBUG /optimize /out:File2.exe *.cs
Compiles all the C# files in the current directory producing a debug version of
File2.dll. No logo and no warnings are displayed
csc /target:library /out:File2.dll /warn:0 /nologo /debug *.cs
Compiles all the C# files in the current directory to Something.useful (a DLL):
csc /target:library /out:Something.useful *.cs
C# Compiler vs. C++ Compiler
There are no object (.obj) files created as a result of invoking the C# compiler; output
files are created directly. As a result of this, the C# compiler does Not need a linker
My First C# Program
Here is our first C# code:
7. // Program.cs
using System;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
namespaceMyFirstCSharpCode
{
class Program
{
static void Main(string[] args)
{
}
}
}
A C# program consists of one or more type declarations. C# requires that all program
be contained within a type (class, interface, structure, enumeration, delegate etc.)
definition. In other words, all data members and methods must be contained within a
type definition. In the above example, only the class type is declared.
The code is created as a new Console Application project
named MyFirstCSharpCode.
The program uses two namespaces. It creates a new namespace
called MyFirstCSharpCode, and uses a predefined namespace called System.
The method Main() is a member of class MyFirstCSharpCode and it's a special
function used by the compiler as the starting point of the program. By default, Visual
Studio names the class defining Main(). Here, it's the Program. So, the file name
isProgram.cs. However, we are free to change this if we so choose.
The class that defines the Main() method is termed the application object (which
can be useful when performing unit tests), we must inform the compiler
which Main() method should be used as the entry point via the /main option of the
command-line compiler.
Note that the signature of Main() is adorned with the static keyword. Static members
are scoped to the class level rather than the object level and can thus be invoked
without the need to first create a new class instance.
In addition to the static keyword, this Main() method has a single parameter, which is
an array of strings:
string[] args
8. To compile the program, we can use Visual Studio or the command-line compiler. To
use the command-line compiler, use the following command:
cscProgram.cs
In this command, csc is the name of the command-line compiler and Program.cs is
the name of the source file.
Let's make the code more interesting:
// Program2.cs
using System;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
namespaceMyFirstCSharpCode
{
class Program2
{
static void Main(string[] args)
{
Console.WriteLine("My first C# code");
Console.WriteLine("Hello World");
Console.WriteLine();
Console.ReadLine();
}
}
}
In the new code, we make use of the Console class, which is defined within
the System namespace. Among its set of members is the static WriteLine() which
pumps a text string and carriage return to the standard output. We also make a call
toConsole.ReadLine() to ensure the command prompt launched by the Visual Studio
2010 IDE remains visible during a debugging session until we press the Enter key.
Note that we have several methods for our Main():
static int Main(string[] args)
static void Main()
static int Main()
Error Code
9. The ability to return an int from Main() keeps C# consistent with other C-based
languages. By convention, returning the value 0indicates the program has terminated
successfully, while another value such as -1 represents an error condition.
On the Windows OS, an application's return value is stored within a system
environment variable named %ERRORLEVEL%. If we were to create an application
that programmatically launches another executable, we can obtain the value
of%ERRORLEVEL% using the
static System.Diagnostics.Process.ExitCode property.
Given that an application's return value is passed to the system at the time the
application terminates, it is obviously not possible for an application to obtain and
display its final error code while running. However, to illustrate how to view this error
level upon program termination, begin by updating the Main() method:
// Program3.cs
using System;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
namespaceMyFirstCSharpCode
{
class Program3
{
staticint Main(string[] args)
{
Console.WriteLine("My first C# code");
Console.WriteLine("Hello World!");
Console.WriteLine();
Console.ReadLine();
return -1;
}
}
}
Let's capture Main()'s return value with the help of a batch file. Using the Windows
Explorer, put MyFirstCSharpCode.bat intoC:DocumentsVisual Studio
2010ProjectsMyFirstCSharpCode folder. The file looks like this:
@echo off
rem A batch file for MyFirstCSharpCode.exe
rem which captures the app's return value.
MyFirstCSharpCode
@if "%ERROELEVEL%" == "0" goto success
10. :fail
echo This application has failed!
echo return value = %ERRORLEVEL%
goto end
:success
echo This application has succeeded!
echo return value = %ERRORLEVEL%
goto end
:end
echo Done.
Let's open a command prompt and navigate to the folder containing our executable and
the new batch file. Execute the batch file by typing in the
name MyFirstCSharpCode.bat and pressing the Enter key. We'll get:
My first C# code
Hello World!
Testing Error
This application has failed!
return value = -1
Done..
However, a vast majority of our C# application will use void as the return value
from Main(), which implicitly returns the error code of zero. We may not the batch file
at all.
Command-Line Arguments
Let's look at the incoming array of string data. Now we want to update our application
to process any possible command-line parameters using a C# for loop.
// Program4.cs
using System;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
namespaceMyFirstCSharpCode
{
class Program4
{
staticint Main(string[] args)
{
Console.WriteLine("My first C# code");
11. Console.WriteLine("Hello World!");
Console.WriteLine();
for(inti = 0; i<args.Length; i++)
Console.WriteLine("Arg: {0}", args[i]);
Console.ReadLine();
return -1;
}
}
}
Here, we are checking to see whether the array of strings contains the number of
items using the Length property ofSystem.Array.
C:>cd CSharp
C:CSharp>csc Program4.cs
Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1
Copyright (C) Microsoft Corporation. All rights reserved.
C:CSharp>Program4 argAargBargC
My first C# code
Hello World!
Arg: argA
Arg: argB
Arg: argC
C:CSharp>
As we loop over each item in the array, its value is printed to the console window.
We can use an alternative to the standard for loop. We may iterate over an
incoming string array using the C# foreachkeyword:
foreach(string a in args)
Console.WriteLine("Arg: {0}", a);
We are also able to access command-line argument using the
static GetCommandLineArgs() method of theSystem.Environment type. The
return value of this method is an array of strings. The first index identifies the name of
the application itself, while the remaining elements in the array contain the individual
command-line arguments.
// Program5.cs
using System;
usingSystem.Collections.Generic;
usingSystem.Linq;
12. usingSystem.Text;
namespaceMyFirstCSharpCode
{
class Program5
{
staticint Main(string[] args)
{
Console.WriteLine("My first C# code");
Console.WriteLine("Hello World!");
Console.WriteLine();
string[] arguments = Environment.GetCommandLineArgs();
foreach(string arg in arguments)
Console.WriteLine("Arg: {0}", arg);
Console.ReadLine();
return -1;
}
}
}
Output is
C:CSharp>csc Program5.cs
Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1
Copyright (C) Microsoft Corporation. All rights reserved.
C:CSharp>Program5 argAargBargC
My first C# code
Hello World!
Arg: Program5
Arg: argA
Arg: argB
Arg: argC
C:CSharp>
Command-Line Arguments with Visual Studio 2010
While in the real world, the user supplies the command-line arguments, we may want
to specify command-line argument during the development cycle.
To specify the arguments with Visual Studio 2010, double-click the Properties icon from
Solution Explorer.
13. Then, select the Debug tab on the left side. After that we can specify values using the
Command line arguments text box.
14. List of C# Tutorials
.NET Framework
Introduction - My First C# Code
System Members and Data
Modifiers
Array
Enumeration (Enums)
Value and Reference Types
Constructor and this Keyword
static Keyword
Encapsulation Services
Inheritance
Inheritance II
Polymorphism
Interfaces
Delegates
System.Object
Events