SlideShare a Scribd company logo
1 of 4
Working with Data
Directory
• System.IO.Directory.CreateDirectory(@"c:my new directory");
• MessageBox.Show(Convert.ToString(System.IO.Directory.Exists(@"c:temp")));
• System.IO.Directory.Move(@"c:current directory name", @"d:new directory name");
• System.IO.Directory.Delete(@"c:temp");
Chapter iii(working with data)

More Related Content

What's hot

2011 mongo FR - scaling with mongodb
2011 mongo FR - scaling with mongodb2011 mongo FR - scaling with mongodb
2011 mongo FR - scaling with mongodbantoinegirbal
 
2011 Mongo FR - MongoDB introduction
2011 Mongo FR - MongoDB introduction2011 Mongo FR - MongoDB introduction
2011 Mongo FR - MongoDB introductionantoinegirbal
 
Automated Slow Query Analysis: Dex the Index Robot
Automated Slow Query Analysis: Dex the Index RobotAutomated Slow Query Analysis: Dex the Index Robot
Automated Slow Query Analysis: Dex the Index RobotMongoDB
 
Superficial mongo db
Superficial mongo dbSuperficial mongo db
Superficial mongo dbDaeMyung Kang
 
Overview on NoSQL and MongoDB
Overview on NoSQL and MongoDBOverview on NoSQL and MongoDB
Overview on NoSQL and MongoDBharithakannan
 
N this article first we will create a table in a my sql database and then we ...
N this article first we will create a table in a my sql database and then we ...N this article first we will create a table in a my sql database and then we ...
N this article first we will create a table in a my sql database and then we ...Mark Daday
 
NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)
NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)
NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)Ontico
 
C# Development (Sam Corder)
C# Development (Sam Corder)C# Development (Sam Corder)
C# Development (Sam Corder)MongoSF
 
File System Operations
File System OperationsFile System Operations
File System OperationsG.C Reddy
 

What's hot (19)

2011 mongo FR - scaling with mongodb
2011 mongo FR - scaling with mongodb2011 mongo FR - scaling with mongodb
2011 mongo FR - scaling with mongodb
 
Public class form1
Public class form1Public class form1
Public class form1
 
2011 Mongo FR - MongoDB introduction
2011 Mongo FR - MongoDB introduction2011 Mongo FR - MongoDB introduction
2011 Mongo FR - MongoDB introduction
 
Mongo indexes
Mongo indexesMongo indexes
Mongo indexes
 
Android APP-toggle case
Android APP-toggle caseAndroid APP-toggle case
Android APP-toggle case
 
Automated Slow Query Analysis: Dex the Index Robot
Automated Slow Query Analysis: Dex the Index RobotAutomated Slow Query Analysis: Dex the Index Robot
Automated Slow Query Analysis: Dex the Index Robot
 
Assist9 bmis
Assist9 bmisAssist9 bmis
Assist9 bmis
 
Superficial mongo db
Superficial mongo dbSuperficial mongo db
Superficial mongo db
 
Overview on NoSQL and MongoDB
Overview on NoSQL and MongoDBOverview on NoSQL and MongoDB
Overview on NoSQL and MongoDB
 
Json training
Json trainingJson training
Json training
 
Mongo db
Mongo dbMongo db
Mongo db
 
N this article first we will create a table in a my sql database and then we ...
N this article first we will create a table in a my sql database and then we ...N this article first we will create a table in a my sql database and then we ...
N this article first we will create a table in a my sql database and then we ...
 
Mongo db queries
Mongo db queriesMongo db queries
Mongo db queries
 
Jsoup
JsoupJsoup
Jsoup
 
MongoDB
MongoDBMongoDB
MongoDB
 
NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)
NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)
NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)
 
Meteor Modelling
Meteor ModellingMeteor Modelling
Meteor Modelling
 
C# Development (Sam Corder)
C# Development (Sam Corder)C# Development (Sam Corder)
C# Development (Sam Corder)
 
File System Operations
File System OperationsFile System Operations
File System Operations
 

More from Chhom Karath

More from Chhom Karath (20)

set1.pdf
set1.pdfset1.pdf
set1.pdf
 
Set1.pptx
Set1.pptxSet1.pptx
Set1.pptx
 
orthodontic patient education.pdf
orthodontic patient education.pdforthodontic patient education.pdf
orthodontic patient education.pdf
 
New ton 3.pdf
New ton 3.pdfNew ton 3.pdf
New ton 3.pdf
 
ច្បាប់ញូតុនទី៣.pptx
ច្បាប់ញូតុនទី៣.pptxច្បាប់ញូតុនទី៣.pptx
ច្បាប់ញូតុនទី៣.pptx
 
Control tipping.pptx
Control tipping.pptxControl tipping.pptx
Control tipping.pptx
 
Bulbous loop.pptx
Bulbous loop.pptxBulbous loop.pptx
Bulbous loop.pptx
 
brush teeth.pptx
brush teeth.pptxbrush teeth.pptx
brush teeth.pptx
 
bracket size.pptx
bracket size.pptxbracket size.pptx
bracket size.pptx
 
arch form KORI copy.pptx
arch form KORI copy.pptxarch form KORI copy.pptx
arch form KORI copy.pptx
 
Bracket size
Bracket sizeBracket size
Bracket size
 
Couple
CoupleCouple
Couple
 
ច្បាប់ញូតុនទី៣
ច្បាប់ញូតុនទី៣ច្បាប់ញូតុនទី៣
ច្បាប់ញូតុនទី៣
 
Game1
Game1Game1
Game1
 
Shoe horn loop
Shoe horn loopShoe horn loop
Shoe horn loop
 
Opus loop
Opus loopOpus loop
Opus loop
 
V bend
V bendV bend
V bend
 
Closing loop
Closing loopClosing loop
Closing loop
 
Maxillary arch form
Maxillary arch formMaxillary arch form
Maxillary arch form
 
Front face analysis
Front face analysisFront face analysis
Front face analysis
 

Recently uploaded

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 

Recently uploaded (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 

Chapter iii(working with data)

Editor's Notes

  1. 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; namespace _12 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void btOpen_Click(object sender, EventArgs e) { openFileDialog1.FileName = ""; openFileDialog1.Filter = "Text Files|*.txt"; openFileDialog1.FilterIndex = 1; if (openFileDialog1.ShowDialog() != DialogResult.Cancel) txt1.Text = openFileDialog1.FileName; else txt1.Text = ""; } private void btSave_Click(object sender, EventArgs e) { saveFileDialog1.Title = "Specify Destination Filename"; saveFileDialog1.Filter = "Text Files|*.txt"; saveFileDialog1.FilterIndex = 1; saveFileDialog1.OverwritePrompt = true; if (saveFileDialog1.ShowDialog() != DialogResult.Cancel) txt2.Text = saveFileDialog1.FileName; } private void btCopy_Click(object sender, EventArgs e) { if (!System.IO.File.Exists(txt2.Text)) { System.IO.File.Copy(txt1.Text, txt2.Text); MessageBox.Show("The file has been successfully copied."); } } private void btMove_Click(object sender, EventArgs e) { if (!System.IO.File.Exists(txt1.Text)) { MessageBox.Show("Not Found file te!"); } else { System.IO.File.Move(txt1.Text, txt2.Text); MessageBox.Show("The file has been successfully moved."); } } private void btDelete_Click(object sender, EventArgs e) { if (!System.IO.File.Exists(txt1.Text)) return; if (MessageBox.Show("Are you sure you want to delete the source​file?", "Delete Verification",MessageBoxButtons.YesNo,MessageBoxIcon.Question)== DialogResult.Yes) { System.IO.File.Delete(txt1.Text); MessageBox.Show("The file has been successfully deleted."); } } private void btAttrib_Click(object sender, EventArgs e) { System.Text.StringBuilder stbProperties = new System.Text.StringBuilder(""); System.IO.FileAttributes fileAttributes; stbProperties.Append("Created: "); stbProperties.Append(System.IO.File.GetCreationTime(this.txt1.Text)); stbProperties.Append("\r\n"); stbProperties.Append("Accessed: "); stbProperties.Append(System.IO.File.GetLastAccessTime(txt1.Text)); stbProperties.Append("\r\n"); stbProperties.Append("Modified: "); stbProperties.Append(System.IO.File.GetLastWriteTime(txt1.Text)); fileAttributes = System.IO.File.GetAttributes(txt1.Text); stbProperties.Append("\r\n"); stbProperties.Append("Normal: "); stbProperties.Append(Convert.ToBoolean((fileAttributes & System.IO.FileAttributes.Normal)== System.IO.FileAttributes.Normal)); stbProperties.Append("\r\n"); stbProperties.Append("Hidden: "); stbProperties.Append(Convert.ToBoolean((fileAttributes & System.IO.FileAttributes.Hidden)== System.IO.FileAttributes.Hidden)); stbProperties.Append("\r\n"); stbProperties.Append("ReadOnly: "); stbProperties.Append(Convert.ToBoolean((fileAttributes & System.IO.FileAttributes.ReadOnly)== System.IO.FileAttributes.ReadOnly)); stbProperties.Append("\r\n"); stbProperties.Append("System: "); stbProperties.Append( Convert.ToBoolean((fileAttributes & System.IO.FileAttributes.System) == System.IO.FileAttributes.System)); stbProperties.Append("\r\n"); stbProperties.Append("Temporary File: "); stbProperties.Append( Convert.ToBoolean((fileAttributes & System.IO.FileAttributes.Temporary) == System.IO.FileAttributes.Temporary)); stbProperties.Append("\r\n"); stbProperties.Append("Archive: "); stbProperties.Append( Convert.ToBoolean((fileAttributes & System.IO.FileAttributes.Archive) == System.IO.FileAttributes.Archive)); txtAttrib.Text = stbProperties.ToString(); } } }
  2. 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; namespace _12 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void btOpen_Click(object sender, EventArgs e) { openFileDialog1.FileName = ""; openFileDialog1.Filter = "Text Files|*.txt"; openFileDialog1.FilterIndex = 1; if (openFileDialog1.ShowDialog() != DialogResult.Cancel) txt1.Text = openFileDialog1.FileName; else txt1.Text = ""; } private void btSave_Click(object sender, EventArgs e) { Boolean b; saveFileDialog1.Title = "Specify Destination Filename"; saveFileDialog1.Filter = "Text Files|*.txt"; saveFileDialog1.FilterIndex = 1; saveFileDialog1.OverwritePrompt = true; if (saveFileDialog1.ShowDialog() != DialogResult.Cancel) txt2.Text = saveFileDialog1.FileName; } private void btCopy_Click(object sender, EventArgs e) { if (!System.IO.File.Exists(txt2.Text)) { MessageBox.Show("The source file does not exist!"); System.IO.File.Copy(txt1.Text, txt2.Text); MessageBox.Show("The file has been successfully copied."); } } private void btMove_Click(object sender, EventArgs e) { if (!System.IO.File.Exists(txt1.Text)) { MessageBox.Show("Not Found file te!"); } else { System.IO.File.Move(txt1.Text, txt2.Text); MessageBox.Show("The file has been successfully moved."); } } private void btDelete_Click(object sender, EventArgs e) { if (!System.IO.File.Exists(txt1.Text)) return; if (MessageBox.Show("Are you sure you want to delete the source​file?", "Delete Verification",MessageBoxButtons.YesNo,MessageBoxIcon.Question)== DialogResult.Yes) { System.IO.File.Delete(txt1.Text); MessageBox.Show("The file has been successfully deleted."); } } private void btAttrib_Click(object sender, EventArgs e) { System.Text.StringBuilder stbProperties = new System.Text.StringBuilder(""); System.IO.FileAttributes fileAttributes; stbProperties.Append("Created: "); stbProperties.Append(System.IO.File.GetCreationTime(this.txt1.Text)); stbProperties.Append("\r\n"); stbProperties.Append("Accessed: "); stbProperties.Append(System.IO.File.GetLastAccessTime(txt1.Text)); stbProperties.Append("\r\n"); stbProperties.Append("Modified: "); stbProperties.Append(System.IO.File.GetLastWriteTime(txt1.Text)); fileAttributes = System.IO.File.GetAttributes(txt1.Text); stbProperties.Append("\r\n"); stbProperties.Append("Normal: "); stbProperties.Append(Convert.ToBoolean((fileAttributes & System.IO.FileAttributes.Normal)== System.IO.FileAttributes.Normal)); stbProperties.Append("\r\n"); stbProperties.Append("Hidden: "); stbProperties.Append(Convert.ToBoolean((fileAttributes & System.IO.FileAttributes.Hidden)== System.IO.FileAttributes.Hidden)); stbProperties.Append("\r\n"); stbProperties.Append("ReadOnly: "); stbProperties.Append(Convert.ToBoolean((fileAttributes & System.IO.FileAttributes.ReadOnly)== System.IO.FileAttributes.ReadOnly)); stbProperties.Append("\r\n"); stbProperties.Append("System: "); stbProperties.Append( Convert.ToBoolean((fileAttributes & System.IO.FileAttributes.System) == System.IO.FileAttributes.System)); stbProperties.Append("\r\n"); stbProperties.Append("Temporary File: "); stbProperties.Append( Convert.ToBoolean((fileAttributes & System.IO.FileAttributes.Temporary) == System.IO.FileAttributes.Temporary)); stbProperties.Append("\r\n"); stbProperties.Append("Archive: "); stbProperties.Append( Convert.ToBoolean((fileAttributes & System.IO.FileAttributes.Archive) == System.IO.FileAttributes.Archive)); txtAttrib.Text = stbProperties.ToString(); } private void btCreateFolder_Click(object sender, EventArgs e) { System.IO.Directory.CreateDirectory(this.txtDir.Text ); } private void t_Click(object sender, EventArgs e) { System.IO.Directory.Delete(this.txtDir.Text); } private void btShowDir_Click(object sender, EventArgs e) { MessageBox.Show(Convert.ToString(System.IO.Directory.Exists(this.txtDir.Text ))); } private void btMoveDir_Click(object sender, EventArgs e) { System.IO.Directory.Move(@"D:\d",@"C:\d"); } } }