dotnetspider.com
Login Login    Register      

TutorialsForumCareer DevelopmentResourcesReviewsJobsInterviewCommunitiesProjectsTraining

Subscribe to Subscribers
Talk to Webmaster
Tony John

Facebook
Google+
Twitter
LinkedIn
Online MembersShine S
More...
Join our online Google+ community for Bloggers, Content Writers and Webmasters




Forums » .NET » .NET »

File Handling


Posted Date: 23 Nov 2009      Posted By:: Narasimha     Member Level: Silver    Member Rank: 2040     Points: 1   Responses: 1




Hi All,

How to Browse copy, copy file into a current directory ?




Responses

#445971    Author: Asheej T K        Member Level: Diamond      Member Rank: 2     Date: 23/Nov/2009   Rating: 2 out of 52 out of 5     Points: 2

To read the file use below code


StreamReader sr = new StreamReader(strFileNameToRead);
line = sr.ReadLine();
while (line != null)
{
//Code to do your operation
}


To copy file try below code,


DirectoryInfo di = new DirectoryInfo(strTofileDir);
File.Copy(strFromFilePathandName,strToFilePathandName,true);


I hope you can pass the proper value by reading the variable name i have used in the example...


Regards,
Asheej T K
Microsoft MVP[ASP.NET/IIS]
DotNetSpider MVM

Dotnet Galaxy



 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : DataGridView--CheckBox
Previous : Please good book or reference material on T-SQL with C#
Return to Discussion Forum
Post New Message
Category:

Related Messages



Follow us on Twitter: https://twitter.com/dotnetspider

Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Email subscription
  • .NET Jobs
  • .NET Articles
  • .NET Forums
  • Articles Rss Feeds
    Forum Rss Feeds


    About Us    Contact Us    Copyright    Privacy Policy    Terms Of Use    Revenue Sharing sites   Advertise   Talk to Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.