While and Writeline in c sharp

December 9th, 2008

C# code for While and Writeline

1. While1.cs :

class zzz
{
static void Main()
{
int ii;
ii=1;
while ( ii < = 5 )
{
System.Console.WriteLine (”Hi {0}”, ii);
ii++;
}
}
}

2. Writeline1.cs :

// created on 3/1/2008 at 12:36 AM
class callingfunction
{
static void Main(){

System.Console.WriteLine(”Hundred ={0}”,100);

}
}

Virtual Override

November 24th, 2008

Similar to C# code for virtual we provide you Virtual OverRide code

class zzz
{
public static void Main()
{
yyy a = new yyy();xxx b = new xxx();yyy c = new xxx();
a.abc();a.pqr();a.xyz();
b.abc();b.pqr();b.xyz();
c.abc();c.pqr();c.xyz();
}}
class yyy
{
public virtual void abc()
{System.Console.WriteLine(”yyy abc”);}
public virtual void pqr()
{System.Console.WriteLine(”yyy pqr”);}
public virtual void xyz()
{System.Console.WriteLine(”yyy xyz”);}
}
class xxx : yyy
{
public override void abc()
{System.Console.WriteLine(”xxx abc”);}
public new void pqr()
//New means that the function pqr is a new function and it has absolutely nothing to do with the pqr in the base class
{
System.Console.WriteLine(”xxx pqr”);
}
public void xyz()
{
System.Console.WriteLine(”xxx xyz”);
}}

Virtual.cs C# code

November 5th, 2008

Virtual.cs
===

class zzz
{
public static void Main()
{
yyy a = new xxx();
yyy b = new vvv();
xxx c = new vvv();
a.abc();a.pqr();a.xyz();b.abc();b.pqr();b.xyz();c.abc();c.pqr();c.xyz();}}
class yyy
{
public void abc()
{System.Console.WriteLine(”yyy abc”);}
public virtual void pqr()
{System.Console.WriteLine(”yyy pqr”);}
public virtual void xyz()
{System.Console.WriteLine(”yyy xyz”);}
}
class xxx : yyy
{
public virtual void abc()
{System.Console.WriteLine(”xxx abc”);}
public new void pqr()
{System.Console.WriteLine(”xxx pqr”);}
public override void xyz()
{System.Console.WriteLine(”xxx xyz”);}
}
class vvv : xxx
{
public override void abc()
{System.Console.WriteLine(”vvv abc”);}
public void xyz()
{System.Console.WriteLine(”vvv xyz”);}
}

Using.cs
===

using System;
using ashish;
class zzz {
static void Main()
{
yyy.abc();
}
}
namespace ashish
{
class yyy
{
public static void abc()
{
Console.WriteLine(”abc”);
}
}
}
//After the word using you can only write the name of a namespace…

Unsafe code in C#

October 21st, 2008

Unsafe : This means pointers are allowed in C# code. If you wish to compile unsafe code then should specify the /unsafe compiler option in the command line(This is not required if you are using Visual Studio.NET).

using System;
class zzz {
public static void Main() {
yyy a = new yyy();
a.abc();
}
}
unsafe class yyy {
unsafe public void abc() {
int *i; //declaring pointer
int j=1;
i = &j; //pointing
Console.WriteLine((int)i);
*i = 10;
Console.WriteLine(j);
}
}

C# code for Throw

October 10th, 2008

class zzz
{
public static void Main()
{
yyy a;
a=new yyy();
try
{
a.abc();
System.Console.WriteLine(”Bye”);
}
catch (System.Exception e)
{
System.Console.WriteLine(”In Exception”+ e.ToString());
}
System.Console.WriteLine(”After Exception”);
System.Console.Read();
}
}
class yyy {
public void abc()
{
throw new System.Exception(”C# Throw code exception”);
System.Console.WriteLine(”C# Throw code“);
}
}

Threads in C# programming

September 30th, 2008

1. C# Threads Example 1
using System.Threading;
public class yyy
{
public void abc()
{
for ( int i = 0; i< =3;i++)
{
System.Console.Write(i + ” “);
}
}
public void pqr()
{
for ( int i = 0; i<=3;i++)
{
Thread.Sleep(1000);
System.Console.Write(i+ “…”);
}
}
}
public class zzz
{
public static void Main()
{
yyy a = new yyy();
Thread t = new Thread(new ThreadStart(a.abc));
Thread t1 = new Thread(new ThreadStart(a.pqr));
t.Start();
t1.Start();
}
}

2. Example 2 of threading in C Sharp (C#)
using System;
using System.Threading;

class App {
public static void Main() {

Console.WriteLine(” (Hit or Press Enter to terminate the sample)”);
Timer timer = new Timer(new TimerCallback(CheckStatus), null, 1, 2000);

Console.WriteLine(”Press Enter to close window”);
Console.Read();
}

// The callback method’s signature MUST match that of a System.Threading.TimerCallback
// delegate (it takes an Object parameter and returns void)
static void CheckStatus(Object state) {
Console.WriteLine(”Threads in C # sharp”);

}
}

Tip of the day script

September 9th, 2008

Part 1 - q.readme.txt
These three different scripts read a single line from a file containing quotes, or “one-liners” as they’re sometimes called. Of course, you need a file of quotes to begin with, so I included my own quotes file in the zip file.

The first one seeds the randoming function which selects a random quote from the quote array. The second one uses the shuffle function to select a random quote from the quote array.

The third one is a little more complex. On Windows machines, and on ‘nix machines where the permissions are set, the code creates the quotes counter file if it doesn’t already exist. Otherwise, you’ll have to create a blank file and set permissions before installing the script.

It selects the next quote each time the script executes. This is done by updating the element number of the array in a separate file.

In each example, the “quotes” file path and file name is the first line of code. The third example contains the “qfile” variable with the path and file name as the second line of code.

Part 2 - Quotes1.inc
< ?
$quote = file("quotes.txt");
srand((double)microtime()*1000000);
echo $quote[rand(0,count($quote))];
?>

Part 3 - Quotes2.inc
< ?
$quote = file("quotes.txt");
echo $quote[shuffle($quote)];
?>

Part 4 - Quotes3.inc
< ?
$quote = file ("quotes.txt");
$qfile = "qnumber.inc";
if (file_exists ($qfile)) {
$fp = fopen ($qfile,"r+");
$qc = fgets ($fp,4);
$qc = chop ($qc);
$qc += 1;
if ($qc == count($quote))
$qc = 0;
rewind ($fp);
fputs ($fp,substr($qc." ",0,4));
fclose ($fp);
echo $quote[$qc];
}
else {
$fp = fopen($qfile,"w");
$qc = 0;
fputs ($fp,substr($qc." ",0,4));
fclose ($fp);
echo $quote[$qc];
}
?>

Part 5 - Quotes.txt
Which should contain tip of the day and or quotes line by line.

System Variables in C#

August 31st, 2008

C# code for System Variables

class zzz
{
public static void Main(){
System.Collections.IDictionary i=System.Environment.GetEnvironmentVariables ();
System.Collections.IDictionaryEnumerator d=i.GetEnumerator();
System.Console.WriteLine(”Content-Type:text/html\n”);
System.Console.WriteLine(i.Count + “
“);
while (d.MoveNext())
{
System.Console.WriteLine(”{0}={1}
“,d.Key,d.Value);
}}}

Struct program in C#

July 25th, 2008

One of the simplest program for Struct…

===
class zzz
{
public static void Main()
{
xxx a = new xxx(10);
}
}
struct xxx
{
public int i,j;
public xxx(int p)
{
i = p;
j = 0;
}
}
===

Just compile it and run it to understand the c# code better.

Static in C#

June 3rd, 2008

Static in c#
===
class zzz
{
static void Main()
{
yyy a=new yyy();
a.abc();
yyy.pqr();
}
}
class yyy
{
public void abc()
{
System.Console.WriteLine(”C# at abc”);
}
public static void pqr()
{
System.Console.WriteLine(”C# at pqr”);
}
}

PS : VB Developers have the biggest problem understanding static when migrating from programming language Visual basic to a C#.

Basics of C#

May 14th, 2008

WriteLine.cs and Return.cs :

1. WriteLine.cs
===
// created on 3/1/2002 at 12:36 AM
class callingfunction
{
static void Main(){

System.Console.WriteLine(”Hundred ={0}”,100);

}
}
===

2. Return.cs
===
class zzz
{
static void Main()
{
int ii = abc();
System.Console.WriteLine(”hi {0}”,ii);
}
static int abc()
{
System.Console.WriteLine(”abc”);
return 100;
// after return everything ignored
System.Console.WriteLine(”abc”);
}
}
===

Reflection in c#

April 29th, 2008

Reflection is a process by which an application can read and collect data from assemby and metadata.

Reflection.cs
===
using System;
using System.Reflection;
class zzz
{
public static void Main()
{
Type m;
m = typeof(int);
System.Console.WriteLine(m.Name + ” ” + m.FullName);
m = typeof(System.Int32);
System.Console.WriteLine(m.Name + ” ” + m.FullName);
m = typeof(yyy);
System.Console.WriteLine(m.Name + ” ” + m.FullName);
m=typeof(string);
MemberInfo [] n;
n = m.GetMembers();
Console.WriteLine(n.Length);
foreach ( MemberInfo a in n)
{
Console.Write(a.Name+”,”);
}
System.Console.WriteLine(m.Name + ” ” + m.FullName);
}
}
class yyy
{
}
===

Read from Web using C#

April 22nd, 2008

Here again we will use System.Net and the classes we shall use in the c# code from the .NET framework are WebRequest and WebResponse. WebRequest and WebResponse classes from the .NET Library are used to to request web-pages from the internet.

Readnet.cs
===
using System;
using System.Net;
using System.IO;
class zzz
{
public static void Main()
{
WebRequest r = WebRequest.Create(”http://www.jimmysvalueworld.com”);
WebResponse re = r.GetResponse();
Stream s = re.GetResponseStream();
Byte[] a = new Byte[51200];
int b = s.Read(a, 0, 51200);
Console.WriteLine(b);
Console.Write(System.Text.Encoding.ASCII.GetString(a, 0, b));
}
}
===

Sales Intimidator

March 31st, 2008

“Use This Incredible New Script To Actually Force Your Website Visitors To Purchase Your Products, Spend More Cash, And Keep Coming Back For More and More…”

-> Smart Internet E-Marketers All Over the WWW have Already Discovered How Sales Intimidator Sends More Visitors Scrambling For Their Credit Cards As Fast And As OFTEN As They Possibly Can…

Let’s get to the point….

To make more money from your web-site, you gotto increase the traffic plus increase conversions on the traffic you are already getting. You need your sales promo page to sell more copies plus you need your visitors to spend more money.

What it does :

1. First Hit : Only XX copies remain - Showing your website visitor the number of copies remaining does two things for you… First of all the falling number Creates a sense of urgency for your prospect, and as the lower it goes, the more it works in your favour.

2. Strike two : The SECOND BLOW is that the user cannot leave the page, come back later and still get your reduced price!
When the user refreshes the sales page, or leaves and comes back later, they will automatically be redirected to your “page 2 offer”. This page will have another offer for your visitor, only at a higher price.

Another reat advantage is it provides what is known as “social proof” that other people are buying this product too - “so it must be great!” We humans are instinctive creatures, and when we see others doing something, we have more confidence in our decision to do it too.

3. Knockout : Time based - Order in The Next XX Minutes and get ….

This is no ploy. Now when you give your visitors a countdown, YOU REALLY MEAN IT!

With Sales Intimidator you get :

  • Your Own Copy of Sales Intimidator!
  • Unlimited Domain Licence!
  • Full UNRESTRICTED Private Label Rights to Sales Intimidator, to use ANY way you wish!
  • Copy of This Salespage!
  • Graphics and .PSD Files for Easy Editing!
  • Unencrypted Sourcecode and Full Sourcecode Rights to Add, Subtract, or Edit ANY Way You Want!

    Get the incredible Sales Intimidator Php script for $9.95 ONLY

  • Popular web scripts

    February 10th, 2008

    Run your own Youtube site or popular social bookmarking site like Myspace and make money through advertising or adsense.

    Nowadays Web 2.0 sites are the most popular ones and have the most number of visitors. Some of them include Youtube, Social sites like Myspace and Orkut.com

    You can now run such sites easily with Website clones script package.

    Website clones of Youtube, myspace, shorter Url script and more

    The scripts that are a part of this package include :

  • Clone of Myspace.com.
  • Clone of YouTube.com.
  • Run Imaging site like Image Shack.com.
  • Hotscripts.com clone.
  • File Sharing website site like Rapidshare.de.
  • Adultcheck clone - Age verification system.
  • Script like site WhatIsMyIP.com.
  • A clone of xdrive.com to backup files.
  • Clone of Yahoo GEOCITIES.
  • Shorter URL script like TinyUrl.com
  • and also clones of Anonym.to, ImageShack.com, Freedomain.co.nr and SaveFile.com

    Buy Website clones script for $9.95 Only

  • Membership management script

    January 27th, 2008

    Membership management script - Membership Juggernaut

    Membership sites are the sites of the future. This incredible script will make your whole management process a breeze.

    It is a fact that 90% of Internet marketing gurus or Internet marketing advisors make it big for them with the use of such membership sites.

    With such a cool thing you can :

  • Run your own subscription site. Create members and a huge mailing list.
  • Recruit and keep track of your affiliates
  • Make recurring income from your site by charging a periodical fee.
  • Automatically manage your subscription account.
  • Show your credibility to your members through proper use of such a membership site.
  • Increase your reputation among site owners and members.
  • Increase your Joint Ventures.

    What is so good about this particular script is that it make everything professional and easy for you.

    The features of this script are :

  • Accept one time payment via PayPal or accept recurring subscription fees using Paypal.
  • View/Add/Modify or Delete your members profile using your Admin Control Panel.
  • Easily keep track of affiliate-stats.
  • Entire process of sending e-mail notification to your members either when they join or cancel their membership.
  • E-mail your members right from your Admin panel - It can be any information - Adding new product, make an announcement/news or any special messge just for your members.
  • No scripting or programming knowledge needed - Easily edit your Member’s main pages, Admin pages or login pages.
  • And so much more…


    Click here to buy this incredible Membership management script for $9.95 Only

  • Download site creator script

    January 17th, 2008

    Download site creator script

    About Download site creator script : The incredible script will help you run a download-gallery in your site where you can properly categorize all of your e-products.

    Features of Download site creator script :

  • Is easily customizable including headers and footers
  • Easily create categories and downloads.
  • Is user-friendly and very easy to use.
  • Add/Edit and Delete downloads fast.
  • The ‘Add Download form’ does not add unnecessary details to fill up, like many other download scripts do.
  • Download page will appear cleaner and professional to your members which means good reputation for your site.
  • Let your members, users located links to your products easily and faster hence saving them from frustration.
  • No need to upload Html file or the tension of having a large download page.
  • You wont need to manually edit any code or H.T.M.L

    Screenshot of Download site creator script

    Get Download site creator for $9.95 Only

  • We wish you a Happy new year

    January 1st, 2008

    The team at Fullycoded.com wishes you a very happy and prosperous new year :)

    We promise to deliver you better website scripts and vb source code this year.

    Regards,
    ASHISH H THAKKAR and the People at Fullycoded.com

    Read a file in C#

    November 2nd, 2007

    Read0.cs
    ===
    using System;
    using System.IO;
    namespace ns{
    class zzz
    {
    public static void Main()
    {
    FileStream f = new FileStream(”c:\\c\\pointers.cs”, FileMode.Open, FileAccess.Read);
    byte [] a;
    a = new byte[512];
    int b = f.Read(a, 0, 512);
    Console.WriteLine(b);
    string s = System.Text.Encoding.ASCII.GetString(a, 0, b);
    Console.Write(s);
    }
    }
    }
    ==

    Read.cs
    ===
    using System.IO;
    class read{
    public static void Main()
    {
    File a=new File(”C:\\jimmy\\Comp\\Microsoft\\C#\\C#.txt”);
    Stream sr=a.OpenRead();
    int fp;
    do{
    fp=sr.ReadByte();
    if(fp != -1)
    System.Console.WriteLine(fp.ToString());
    }
    while( fp != -1);
    sr.Close();
    }
    }
    ==

    Joint Venture Firesale Automator

    September 29th, 2007

    With Joint Venture Firesale Automator you can run joint ventures easily because now you have the right tool that will help you manage the entire process easily all by yourself.

    Whether Your JV Involves Selling Time Limited based Products, One Time Offers, FireSales or Just simple Signups You can just automate your entire Joint Venture easily with Joint Venture FireSale Automator !

    Joint venture firesale automatorAdvantages of JV Firesale automator :

  • Completely template based so you do not have to do any coding.
  • Edit sales letter templates to suit yourself.
  • Fully automate JV start/end dates.
  • Saves you money coz you will not have to buy any expensive softwares or other joint venture software for this - You can automatically display order buttons or signup forms.
  • No upload download issues as everything is done though admin area. Automation of prices - Changes prices at midnight (if opted) and updates the paypal/stormpay button plus updates firsale prices on your sales page.
  • Track referrals and and reward joint venture partners automatically.
  • Manage teaser pages easily.
  • Automatically the member’s area will display contest details according to contest timings.
  • Automate email communication
  • No cheating allowed. Fully IPN supported - for paypal and stormpay.
  • Be more personal - Personalize each and every member plus Jv partner.
  • Automation of payment of commision to Jv partners.
  • Joint Venture Firsale automator is very easy to install.


    Get the Joint venture firesale automator script for $9.95 Only