c# Directory Info Kullanımı

c# Directory Info Kullanımı

2. May 2009

Read this article in your language IT | EN | DE | ES

Merhaba arkadaşlar bu örnek dersimizde c# Directory ınfo sınıfımızı  nasıl  kullanırız onu görelim 

işlemler  başlıyalım ilk önçe visual studio 2008 yada 2005 acıyoruz 

bir adet listbox  ekliyoruz form  üzerine 

form load anında kodumuza gecelim 

 

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.IO;

 

namespace DirectoryInfoSınıfı

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

        private void Form1_Load(object sender, EventArgs e)

        {

//yazmış oldugumuz metod cagırıyoruz form load anında listbox gelen degerlei görüş olacaksınız 

            Lİstele();

        }

 //burda geriye deger dönen bir metod tanımlıyoruz

        void Lİstele()

        {// Directory Sınıfımız System.IO Sınıfından türedini görüyoruz       

DirectoryInfo di = new DirectoryInfo("C:\\");

// burada LINQ sorgumuzu  yazıyoruz  

var dirQuery =from dir in di.GetDirectories() orderby di.Name select new { dir.Name };

            foreach (var item in dirQuery)

            listBox1.Items.Add(item.Name);

        }

    }

}

Evet arkadaşlar bir makkalenin  sonuna gelmiş olduk tekrar yeni bir makkalede görüşmek üzere 

Saygılarımla Orhan Türk 

 

 

FacebookDigg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

C# , LINQ

Comments

5/6/2010 1:20:00 AM #
The first to pay attention to, is their customer service as this is the most important thing you will need from who you are putting your money into. To check whether they have a reliable customer service is to try to contact via email or phone if possible. Look at the time frame on how long they reply and the answer they give to you.
5/17/2010 12:36:22 AM #
To check whether they have a reliable customer service is to try to contact via email or phone if possible. Look at the time frame on how long they reply and the answer they give to you.
5/21/2010 5:09:05 PM #
Hi admin, your web page's design is fancy and i like it. Your posts are great. Please continue this great work. Cheers!!
5/22/2010 1:30:15 AM #
You made some good points there. I did a search on the topic and found most people will agree with your blog.
5/27/2010 10:15:21 PM #
Hey there, just stumbled upon your blog through an email from a mate, and found it to be really unique. Im gonna keep an eye on this one. Cheers!
5/28/2010 12:49:47 AM #
Hey there, just stumbled upon your blog through Bing, and found it to be really unique. Im gonna keep an eye on this one. Cheers!
5/29/2010 10:56:37 AM #
Hows it going
I can't  really agree with your entry but there are some parts I never thought of before.  I like the colors you use with your site.
6/2/2010 3:56:06 PM #
Glad to see you're implementing the importance of design Smile I've also just started using blog engine. I'd be interested to know how you're getting on with it.

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Sayfa 0.015625 saniyede yuklendi.