Wednesday 30 October 2013

Tuesday 29 October 2013

Monday 28 October 2013

Write a program to read a list of words, sort the words in alphabetical order and display them one word per line. Also give the total number of words in the list

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Sort_file_handling
{
    class Program
    {

.Suppose in a scenario if we want to display information only until 5.00 p.m and after that means after 5.00 p.m if any one tries to access the information it should give error message. Then how will you write a event for this ?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Eventanddelegate
{

    public delegate void Time(int t);
   

Wednesday 16 October 2013

How to create WebSite Template Web Application Template in HTML , CSS in .Net




Its a fantastic template for creating a Web-Application and WebSite  . you can use this template for a business to show your Work...

HTML Coding :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Tuesday 15 October 2013

How to create a WebSite or Web Application Template in Html , Css on .Net Framaework




This is a Study Template you can use it if you are creating e-book website or you can also modify it your own.


Coding and Css are Below :

Make a style sheet and add code in that :
Coding CSS  :
/*---------start---------------------*/


body {
}

 .header
 {
       

Friday 11 October 2013

How to copy a file in C# .Net

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace file
{
    class Program
    {
        static void Main(string[] args)
        {
            string path = "my_text.txt";
// copy a file

            int a = 0;
            try
            {
              
                if (a == 0)
                {
                    File.Copy(path, "hell.txt" );
                    a++;
                }
            }
            catch(Exception e)
            {
                Console.WriteLine(e.Message);
           
            }
        
            if (a > 0)
            {
                Console.WriteLine("file copied");

            }
          
        }
    }
}

How to read a file in C# .Net

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace file
{
    class Program
    {
        static void Main(string[] args)
        {
            string path = "my_text.txt";
 StreamReader r = new StreamReader(path);
            string s = r.ReadToEnd();
            foreach (var item in s)
            {
                Console.Write(item);


           }
// 2nd Way to read a file


            string str ="";
            while ((str = r.ReadLine())!=null)
                  {
                      Console.WriteLine(str);
           
           
            }
}
}
}

How to Append a file in C#.Net

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace file
{
    class Program
    {
        static void Main(string[] args)
        {
            string path = "my_text.txt";
           

            if (!File.Exists(path))
            {

                StreamWriter sw = new StreamWriter(path);

                sw.WriteLine("hello");

                sw.Close();
            }
            else
            {

                StreamWriter swr = new StreamWriter(path, true);
                swr.WriteLine("heheehheehe");
                swr.WriteLine("lallalaalal");
                swr.Close();

             }
         }
      }


            }

How to create a file in C# .Net

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace file
{
    class Program
    {
        static void Main(string[] args)
        {
            string path = "my_text.txt";
           

            if (!File.Exists(path))
            {

                StreamWriter sw = new StreamWriter(path);

                sw.WriteLine("hello");

                sw.Close();
            }
   
        }
    }
}