Click here to Skip to main content
15,884,047 members
Home / Discussions / C#
   

C#

 
GeneralRe: Game Programming with C# Pin
Judah Gabriel Himango27-Apr-04 19:21
sponsorJudah Gabriel Himango27-Apr-04 19:21 
GeneralRe: Game Programming with C# Pin
Jeff Varszegi28-Apr-04 2:11
professionalJeff Varszegi28-Apr-04 2:11 
GeneralRe: Game Programming with C# Pin
leppie25-Apr-04 0:08
leppie25-Apr-04 0:08 
GeneralTanks for the Ansers... Pin
Snews25-Apr-04 3:58
Snews25-Apr-04 3:58 
GeneralTree Data Structure Pin
William Blasko24-Apr-04 9:40
William Blasko24-Apr-04 9:40 
GeneralRe: Tree Data Structure Pin
Heath Stewart24-Apr-04 10:20
protectorHeath Stewart24-Apr-04 10:20 
GeneralDirectory Structure Pin
Heilmann24-Apr-04 4:26
sussHeilmann24-Apr-04 4:26 
GeneralRe: Directory Structure Pin
Hesham Amin24-Apr-04 4:41
Hesham Amin24-Apr-04 4:41 
Hi this is a code i use to copy a directory tree..
and I readthe directory tree..(The same as your program)
read it and get the idea Smile | :)
private void cmdCopy_Click(object sender, System.EventArgs e)<br />
{<br />
	if(!Directory.Exists(txtDist.Text))<br />
	{<br />
		MessageBox.Show("Please enter a valid path");<br />
		return;<br />
	}<br />
	DirectoryInfo dir=new DirectoryInfo(txtSrc.Text);<br />
	CopyDirectory(txtSrc.Text,txtDist.Text+"\\"+dir.Name);<br />
	MessageBox.Show("OK");<br />
}<br />
<br />
private void CopyDirectory(string src,string dist)<br />
{<br />
    if(!Directory.Exists(dist))<br />
		Directory.CreateDirectory(dist);<br />
<br />
    FileInfo file;<br />
	DirectoryInfo dir;<br />
	string[] strFiles;<br />
	string[] strDirs;<br />
<br />
	//Copy all files...<br />
	strFiles=Directory.GetFiles(src);<br />
	foreach (string strFile in strFiles)<br />
	{<br />
		file=new FileInfo(strFile);<br />
		file.CopyTo(dist+"\\"+file.Name);<br />
	}<br />
    <br />
	//Copy child directories...<br />
	strDirs=Directory.GetDirectories(src);<br />
	foreach (string strDir in strDirs)<br />
	{<br />
		dir=new DirectoryInfo(strDir);<br />
		if(dir.FullName==dist)//check to prevent infinite loop if the distination is under the source folder..<br />
			continue;<br />
		CopyDirectory(dir.FullName,dist+"\\"+dir.Name);<br />
	}<br />
}

GeneralServer Connections/From Add-in Pin
cnurse24-Apr-04 4:14
cnurse24-Apr-04 4:14 
GeneralWindows Form Designer Error Pin
josefg24-Apr-04 3:41
josefg24-Apr-04 3:41 
GeneralRe: Windows Form Designer Error Pin
josefg24-Apr-04 7:32
josefg24-Apr-04 7:32 
GeneralServiceProcessInstaller.UserName and password inaccessible Pin
jiagia23-Apr-04 22:41
jiagia23-Apr-04 22:41 
GeneralRe: ServiceProcessInstaller.UserName and password inaccessible Pin
Heath Stewart24-Apr-04 10:37
protectorHeath Stewart24-Apr-04 10:37 
Generalsending xml Pin
hmdhmd23-Apr-04 22:13
hmdhmd23-Apr-04 22:13 
GeneralRe: sending xml Pin
Nick Parker24-Apr-04 7:30
protectorNick Parker24-Apr-04 7:30 
GeneralResourceManager Question Pin
hammackj23-Apr-04 19:16
hammackj23-Apr-04 19:16 
GeneralRe: ResourceManager Question Pin
Heath Stewart24-Apr-04 10:34
protectorHeath Stewart24-Apr-04 10:34 
GeneralRe: ResourceManager Question Pin
hammackj24-Apr-04 11:02
hammackj24-Apr-04 11:02 
GeneralRe: ResourceManager Question Pin
Heath Stewart25-Apr-04 4:14
protectorHeath Stewart25-Apr-04 4:14 
Generalchat program Pin
azhar_engineers23-Apr-04 19:00
azhar_engineers23-Apr-04 19:00 
GeneralRe: chat program Pin
Tomas Petricek24-Apr-04 5:10
Tomas Petricek24-Apr-04 5:10 
GeneralRe: chat program Pin
Heath Stewart24-Apr-04 10:28
protectorHeath Stewart24-Apr-04 10:28 
GeneralRe: chat program Pin
Tomas Petricek24-Apr-04 10:39
Tomas Petricek24-Apr-04 10:39 
GeneralRe: chat program Pin
Heath Stewart25-Apr-04 4:09
protectorHeath Stewart25-Apr-04 4:09 
QuestionHow to capture IE output of displaying an XML file? Pin
forgiven4u23-Apr-04 14:28
forgiven4u23-Apr-04 14:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.