CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 12/7/2007 10:24:54 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 15 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
srinivasc_it
Asp.Net User
Searching for named folders in a given directory path in Dotnet and copying them to specified location.12/7/2007 10:24:54 PM

0/0

Hi

I am trying to develop a webform application. On a webform  I placed two textboxes ?Name? and ?Location?. And a command button called ?Install?.  I have several  c# project files in a particular directory located at ?C:\Program Files\Dotnet\csharp_projects? . So say I have 25 c# applications there. Following is what I am trying to achieve.

1. In the ?Name? text box I will type the name of the specific  ?C# project? file folder  say for example ?DatagridDemo? , located within ?C:\Program Files\Dotnet\csharp_projects?.

2. In the ?location? textbox I will Browse or type in the destination path to which this Whole ?DatagridDemo? folder and all of the project files within that folder like .cs, .res etc, must be copied. For example if the destination path specified in the location textbox is ?C:\users?.

3. Clicking on the ?Install?  Button must first search for the named c# project folder (Name text box),  in ?C:\Program Files\Dotnet\csharp_projects? and when found must copy the whole folder to the destination specified in ?location? text box (C:\users). So that when I explore to ?C:\Users? directory, I should see a folder named ?DatagridDemo? and all of the files within it.

So, what are the available libraries  in Dotnet, that I can use while programming this? Are there any readily available functions  for ?searching for  a named folder in a given path? and for ?copying the whole folder and its contents to a given path??. Or I need to code it from scratch

Please, list any good books and resources that explain whole are some of these techniques?.

Thanks,

 

 

DavidKiff
Asp.Net User
Re: Searching for named folders in a given directory path in Dotnet and copying them to specified location.12/9/2007 11:55:11 PM

0/0

Hey! your in luck!  The System.IO namespace provides some great classes for filesystem work.  I would do something like this for your problem :

foreach (string path in Directory.GetDirectories(@"C:\Program Files\Dotnet\csharp_projects"))

{

if (path.Contains("MyApplication"))

{

foreach (string filePath in Directory.GetFiles(path))

{

File.Copy(filePath, @"C:\MyNewDirectory");

}

}

}

 

**Make sure you add using System.IO; :)


David Kiff
http://DavidKiff.co.uk

-- "Mark As Answer" If my reply helped you --
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Searching for named folders in a given directory path in Dotnet ... Searching for named folders in a given directory path in Dotnet and ... copy the whole folder to the destination specified in “location” ...
Microsoft Vista and .NET In effect I performed a recursive search through all the folders below Windows ... The location of this header is given in the file's Data Directory table. ...
vowe dot net :: Are you still using folders to organize your mail? no folders, no flags, no follow ups. use full text search to find the things ( yes, ..... emails just into "Done" folder but put them into specific folders. ...
CodeProject: Demystifying the .NET Global Assembly Cache. Free ... You can also use the Explorer shell to copy the assembly subfolder underneath the current GAC location to the new location specified in the CacheLocation ...
File & Folder Operations - Namespaces and the Base Classes ... Name); AddItem("In Folder: " + fl.Directory); AddItem("Full path: " + fl. ... to the folder C:\dotNET Book and separately lists the files and folders in it. ...
GDT 141&142: Photoshop: Handouts: Chris Cassell Dot Net This applies all directories that have folders inside of them. ... If you are copying to a directory located on one of these drives, click its plus sign to ...
Building Game Explorer Support Into Your XNA Project | coldacid ... Once this path is properly set, change the current directory to the same one .... the base directory, with SavedGames\TitleLocation as the specific location ...
microsoft.public.dotnet.security: RE: CTL_E_PERMISSIONDENIED Private Sub CopyFolder() ... folders and files copied to destination is. ... Application intention is to copy a directory and subfolders from one web ...
Robocopy quotation marks erro ERROR : No Destination Directory Specified. Simple Usage :: ROBOCOPY source .... the creation of individual folders and copy them one at a time. Yuk. ...
C# Programming: Namespaces and the Base Classes Part 4 - File and ... Directory fl = new Directory("C:\\dotNET Book"); AddItem("Connected to folder: " + fl.Name); AddItem("Full path: " + fl.FullName); AddItem("Is Directory: ...




Search This Site:










to find size of wave file

need to modify kit to store files (ppp.,doc.,pdf)

web.con flg file

can somebody tell me how to work visual studio?

what am i missing?

i need help compiling and creating the pa for my mini-app

dnn 3.0.5 - print/xml (rss) error

can vwd2005 create console app?

calling asp functions/subs within asp:textbox tags

configuration files... where to put them??!?!?

inter-module communication

mixing windows authentication with forms authentication

visual studio 2005 help

print a single webpart

response.redirect to parent

cannot create a new dataset

required field validator

problem with login

visual web dev project - compile error bc2017: could not find library

perform item selection using listbox

please help** question about sessions

this error and i can't access to my site anymore ...

postedfile problem

copying module settings with portal template

how to convert html page to pdf file with the help of asp.net

web site structure (references)

how to achive polymorphism in .net

web deployment project : assemblies not merging

gridview web part - paging issue

http status 403: forbidden error when using client certificate. help needed.

 
All Times Are GMT