Simple C# Codes

All tutorials created in C# to be posted in here.
6 posts Page 1 of 1
Contributors
User avatar
NecroPhis
VIP - Donator
VIP - Donator
Posts: 345
Joined: Sun Aug 08, 2010 1:14 pm

Simple C# Codes
NecroPhis
here some C# codes for begginers

//How To Open Second Form (Form2)
Code: Select all
new Form2().Show();
//Minimize / Maximize Form
Minimize =
Code: Select all
this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
Maximize =
Code: Select all
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
//Copy a File to Selected Path On SaveFileDialog(dialog) from C:\
Code: Select all
File.Copy("C:\\Testt.avi", dialog.FileName);
//Delete A File
Code: Select all
File.Delete("C:\\Something.exe");
//Open a Website
Code: Select all
System.Diagnostics.Process.Start("http://www.codenstuff.com");
Here some simple commands cooll;
if u have question(s) PM me
Image
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Simple C# Codes
Axel
and if i do : "Using system.diagnostics;" on top , would that allow me to do "Process.start("google")" i don't know how to import in C# anyways LOL ?
http://vagex.com/?ref=25000
User avatar
NecroPhis
VIP - Donator
VIP - Donator
Posts: 345
Joined: Sun Aug 08, 2010 1:14 pm

Re: Simple C# Codes
NecroPhis
no it must be Process.Start("www.google.com")
Image
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Simple C# Codes
Axel
NecroPhis wrote:
no it must be Process.Start("www.google.com")
i know im just asking about importing classes...
http://vagex.com/?ref=25000
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Simple C# Codes
Axel
but can u make a big list with such a things those will be very useful to me cooll;
http://vagex.com/?ref=25000
User avatar
DreadNought
VIP - Donator
VIP - Donator
Posts: 116
Joined: Fri Jan 08, 2010 12:37 pm

Re: Simple C# Codes
DreadNought
Yes,

Add 'using system.diagnostics;' and just use Process.Start("google.com")

but instead I made a void very very simple
Code: Select all
static void OpenWebsite(string url)
{
process.Start("http://" + url);
}
How to use?
just add
Code: Select all
OpenWebsite("google.com");
dont include http://!
Bound and boom tech,
The Future Of Coding
6 posts Page 1 of 1
Return to “C-Sharp Tutorials”