---
title: "Display Record According to ComboBox Selection in CSharp .NET"  
description: "Here I’m going to  demonstrate how to delete all  Temporary Internet Files of Internet Explorer through C#.Net.Exampleprivatevoid btnDelete_Click(obje"  
author: "Anonymous User"  
published: 2010-07-12  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/57/display-record-according-to-combobox-selection-in-csharp-dot-net  
category: "ado.net"  
tags: ["ado.net"]  
reading_time: 1 minute  

---

# Display Record According to ComboBox Selection in CSharp .NET

Here I’m going to demonstrate how to delete all Temporary Internet Files of

Internet Explorer through C#.Net.

## Example

```
private void btnDelete_Click(object sender, EventArgs e)        {//creating directory
info and asigning it the path of internet cache.DirectoryInfo di
= new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache));//assigning no. of
directories in the folder to x            int x = di.GetDirectories().Count();            //calling clear()
method            clear(di);            MessageBox.Show("Deleted");        } //clear() Method        public void clear(DirectoryInfo di)        {  //loop for each file
in directory                       foreach (FileInfo fi in di.GetFiles())            {                try                {//deleting the file                    fi.Delete();                }                catch (Exception ex)                {                    //MessageBox.Show(ex.Message);                }            }//claaing clear()
method recursively for each directory in current directory.            foreach (DirectoryInfo sub in di.GetDirectories())                clear(sub);        }  
```

---

Original Source: https://www.mindstick.com/articles/57/display-record-according-to-combobox-selection-in-csharp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
