chỉ cần 2 button và 1 folderBrowserDialog roi code đơn giản như sau:
Mã:
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 WindowsFormsApplication1{ public partial class Form1 : Form { public string status; public Form1() { InitializeComponent(); } private void khoa_Click(object sender, EventArgs e) { status = ".{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}"; if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { DirectoryInfo d = new DirectoryInfo(folderBrowserDialog1.SelectedPath); string selectedpath = d.Parent.FullName + d.Name; if (folderBrowserDialog1.SelectedPath.LastIndexOf(".{") == -1) { if (!d.Root.Equals(d.Parent.FullName)) d.MoveTo(d.Parent.FullName + "\\" + d.Name + status); else d.MoveTo(d.Parent.FullName + d.Name + status); } } } private void mokhoa_Click(object sender, EventArgs e) { if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { DirectoryInfo d = new DirectoryInfo(folderBrowserDialog1.SelectedPath); d.MoveTo(folderBrowserDialog1.SelectedPath.Substring(0, folderBrowserDialog1.SelectedPath.LastIndexOf("."))); } } }}
View more random threads:
Vòng tay phong thủy là một vật phẩm mang lại sự may mắn trong tài lộc, tình duyên, sự nghiệp,.. Là một vật phẩm không xa lạ gì với chúng ta, vòng tay phong thủy có nhiều màu, đa dạng và mỗi màu sắc...
Ý nghĩa và cách phân loại vòng tay...