blog post

Rename Folder name and File name in Asp.Net.
We can rename folder and file name by using Move method which is in System.IO.Directory class.

Source Code

<%@ Page Language="C#" %>
<!DOCTYPE html>
<script runat="server">

    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnfolderrename_Click(object sender, EventArgs e)
    {
        string Fromfile = HttpContext.Current.Server.MapPath("oldzip");
        string Tofile = HttpContext.Current.Server.MapPath("oldziprename");
        System.IO.Directory.Move(Fromfile, Tofile);

        Response.Write("Successfully Renamed Folder");
    }
    protected void btnfilerename_Click(object sender, EventArgs e)
    {
        string Fromfile = HttpContext.Current.Server.MapPath("unzipper.aspx");
        string Tofile = HttpContext.Current.Server.MapPath("un-zipper.aspx");
        System.IO.Directory.Move(Fromfile, Tofile);
        
        Response.Write("Successfully Renamed File");
    }


</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Rename File and Folder</title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:Button ID="btnfolderrename" runat="server" Text="Rename Folder" OnClick="btnfolderrename_Click" /><asp:Button ID="btnfilerename" runat="server" Text="Rename File" OnClick="btnfilerename_Click" />&nbsp;&nbsp;&nbsp;
</div>
</form>
</body>
</html>

  • Share This Story


Pleas give your valuable comments to improve the contents.

about author

Atul kumar shukla


I'm Atul Kumar Shukla, working as a web developer.
Welcome to my Blog. This is my personal blog where i post my own questions and answers , articles about ASP.Net., SQL Server, HTML, CSS, Jquery and many more..

Visit Profile

Comments (53)

  • Ann Weaver

    Wednesday, 26 July, 2017 07:22 PM

    I came across your Rename Folder and File in C#, ASP.Net -TheOneblogs.com website and wanted to let you know that we have decided to open our POWERFUL and PRIVATE web traffic system to the public for a limited time! You can sign up for our targeted traffic network with a free trial as we make this offer available again. If you need targeted traffic that is interested in your subject matter or products start your free trial today: http://v-doc.co/nm/jkfq0 Unsubscribe here: http://priscilarodrigues.com.br/url/11

  • Pettigrew

    Thursday, 24 November, 2016 07:50 AM

    Nice

  • Rebecca

    Friday, 18 November, 2016 09:21 PM

    Hello my name is Rebecca and I just wanted to send you a quick note here instead of calling you. I came to your Rename Folder and File in C#, ASP.Net -TheOneblogs.com page and noticed you could have a lot more traffic. I have found that the key to running a successful website is making sure the visitors you are getting are interested in your website topic. There is a company that you can get keyword targeted visitors from and they let you try their service for free for 7 days. I managed to get over 300 targeted visitors to day to my website. http://thfox.com/4ZDf

  • Joselyn

    Sunday, 06 November, 2016 04:37 AM

    Hello my name is Joselyn and I just wanted to drop you a quick message here instead of calling you. I came to your Rename Folder and File in C#, ASP.Net -TheOneblogs.com website and noticed you could have a lot more hits. I have found that the key to running a popular website is making sure the visitors you are getting are interested in your subject matter. There is a company that you can get keyword targeted traffic from and they let you try the service for free for 7 days. I managed to get over 300 targeted visitors to day to my site. http://macanasmagazine.com/yourls/m3qm - Unsubscribe here: http://www.dreamingson.com/r/ur

  • Nicole

    Tuesday, 01 November, 2016 09:17 AM

    Hello my name is Nicole and I just wanted to send you a quick message here instead of calling you. I came to your Rename Folder and File in C#, ASP.Net -TheOneblogs.com website and noticed you could have a lot more hits. I have found that the key to running a popular website is making sure the visitors you are getting are interested in your website topic. There is a company that you can get keyword targeted visitors from and they let you try their service for free for 7 days. I managed to get over 300 targeted visitors to day to my site. http://www.dreamingson.com/r/uq - Unsubscribe here: http://hw23.de/2291d

  • Knox

    Thursday, 13 October, 2016 04:13 AM

    Nice

  • Finnerty

    Sunday, 09 October, 2016 08:57 PM

    Nice

  • Loraine

    Sunday, 09 October, 2016 07:51 PM

    Hello my name is Loraine and I just wanted to send you a quick note here instead of calling you. I discovered your Rename Folder and File in C#, ASP.Net -TheOneblogs.com website and noticed you could have a lot more traffic. I have found that the key to running a successful website is making sure the visitors you are getting are interested in your website topic. There is a company that you can get keyword targeted traffic from and they let you try the service for free for 7 days. I managed to get over 300 targeted visitors to day to my website. http://nt4.pl/u/5s - Unsubscribe here: http://hothor.se/1u2ei

  • Washburn

    Monday, 26 September, 2016 04:38 AM

    Thank you

  • Baylis

    Monday, 12 September, 2016 11:09 PM

    Nice

  • fifa 17 points

    Wednesday, 07 September, 2016 05:38 AM

    Much thanks! It is an awesome website!. fifa 17 points http://www.poolcommander.hu/?q=node/43325

  • Anaya

    Sunday, 04 September, 2016 11:49 AM

    Nice

  • Jageurs

    Thursday, 01 September, 2016 07:44 PM

    Thank you

  • Furphy

    Tuesday, 30 August, 2016 01:56 AM

    Nice

  • Blackham

    Sunday, 28 August, 2016 08:08 AM

    Thank you

  • Witherspoon

    Saturday, 27 August, 2016 01:28 PM

    Thank you

  • Frome

    Saturday, 27 August, 2016 02:34 AM

    Nice and Thank you

  • Teresa

    Thursday, 25 August, 2016 10:30 AM

    I was just looking at your Rename Folder and File in C#, ASP.Net -TheOneblogs.com website and see that your site has the potential to become very popular. I just want to tell you, In case you didn't already know... There is a website network which already has more than 16 million users, and most of the users are interested in websites like yours. By getting your site on this network you have a chance to get your site more visitors than you can imagine. It is free to sign up and you can read more about it here: http://www.isugarbox.com/yourl/b5 - Now, let me ask you... Do you need your website to be successful to maintain your way of life? Do you need targeted visitors who are interested in the services and products you offer? Are looking for exposure, to increase sales, and to quickly develop awareness for your website? If your answer is YES, you can achieve these things only if you get your site on the network I am describing. This traffic network advertises you to thousands, while also giving you a chance to test the network before paying anything. All the popular websites are using this service to boost their readership and ad revenue! Why aren’t you? And what is better than traffic? It’s recurring traffic! That's how running a successful website works... Here's to your success! Read more here: http://rb2.in/4nS

  • Leverett

    Tuesday, 23 August, 2016 11:00 PM

    Thank you

  • Clinton

    Thursday, 18 August, 2016 09:31 PM

    Thank you

  • Heighway

    Thursday, 18 August, 2016 10:35 AM

    Nice One

  • JimmiXS

    Wednesday, 10 August, 2016 11:25 AM

    nice

  • JimmiXS

    Tuesday, 09 August, 2016 12:47 AM

    Thank you

  • Simmons

    Friday, 22 July, 2016 01:14 AM

    Nice and Clear post

  • Samantha

    Sunday, 17 July, 2016 04:42 PM

    Hello my name is Samantha and I just wanted to send you a quick note here instead of calling you. I discovered your Rename Folder and File in C#, ASP.Net -TheOneblogs.com website and noticed you could have a lot more hits. I have found that the key to running a successful website is making sure the visitors you are getting are interested in your website topic. There is a company that you can get keyword targeted visitors from and they let you try their service for free for 7 days. I managed to get over 300 targeted visitors to day to my website. http://norw.in/7T

  • buy viagra

    Friday, 15 July, 2016 03:17 PM

    I’ve recently started a blog, the information you provide on this website has helped me greatly. Thank you for all of your time & work.

  • aichayu

    Thursday, 07 July, 2016 06:51 AM

    here we go!

  • aichayu

    Saturday, 02 July, 2016 12:32 AM

    nice

  • aichayu

    Thursday, 30 June, 2016 02:55 PM

    here we go!

  • aichayu

    Thursday, 30 June, 2016 12:33 AM

    here we go!

  • aichayu

    Tuesday, 28 June, 2016 03:32 PM

    here we go!

  • aichayu

    Monday, 27 June, 2016 03:57 PM

    here we go!

  • McConnan

    Monday, 27 June, 2016 12:19 PM

    nice

  • aichayu

    Monday, 27 June, 2016 01:30 AM

    Thank you

  • aichayu

    Saturday, 25 June, 2016 04:29 AM

    here we go!

  • aichayu

    Friday, 24 June, 2016 03:28 AM

    here we go!

  • aichayu

    Thursday, 23 June, 2016 02:29 PM

    here we go!

  • solverlovegod

    Saturday, 11 June, 2016 04:25 AM

    Aw, this was a very nice post. In thought I want to put in writing like this moreover ?taking time and precise effort to make an excellent article?but what can I say?I procrastinate alot and by no means seem to get one thing done.

  • solverlovegod

    Friday, 10 June, 2016 03:41 AM

    I am often to blogging and i actually admire your content. The article has actually peaks my interest. I'm going to bookmark your website and preserve checking for brand new information.

  • solverlovegod

    Thursday, 09 June, 2016 05:22 PM

    I was very pleased to search out this web-site.I wished to thanks to your time for this excellent learn!! I undoubtedly having fun with every little bit of it and I've you bookmarked to check out new stuff you weblog post.

  • solverlovegod

    Thursday, 09 June, 2016 02:33 AM

    After examine a number of of the blog posts in your website now, and I really like your manner of blogging. I bookmarked it to my bookmark website list and will likely be checking again soon. Pls try my website as nicely and let me know what you think.

  • solverlovegod

    Wednesday, 08 June, 2016 09:07 AM

    A powerful share, I simply given this onto a colleague who was doing a bit of analysis on this. And he in fact bought me breakfast as a result of I discovered it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for spending the time to discuss this, I really feel strongly about it and love studying extra on this topic. If potential, as you change into experience, would you thoughts updating your blog with extra particulars? It's extremely useful for me. Huge thumb up for this blog submit!

  • solverlovegod

    Wednesday, 08 June, 2016 12:29 AM

    Can I just say what a relief to find someone who truly knows what theyre speaking about on the internet. You undoubtedly know methods to convey a problem to mild and make it important. Extra folks need to read this and perceive this aspect of the story. I cant believe youre no more fashionable because you undoubtedly have the gift.

  • solverlovegod

    Tuesday, 07 June, 2016 07:10 AM

    I? have to check with you here. Which is not one thing I normally do! I enjoy reading a post that can make individuals think. Also, thanks for allowing me to comment!

  • solverlovegod

    Monday, 06 June, 2016 04:19 PM

    This is the correct blog for anyone who needs to seek out out about this topic. You notice a lot its almost onerous to argue with you (not that I really would need?aHa). You undoubtedly put a new spin on a subject thats been written about for years. Great stuff, just nice!

  • Donna

    Monday, 16 May, 2016 05:14 PM

    Did you just create your new Facebook page? Do you want your page to look a little more "established"? I found a service that can help you with that. They can send organic and 100% real likes and followers to your social pages and you can try before you buy with their free trial. Their service is completely safe and they send all likes to your page naturally and over time so nobody will suspect that you bought them. Try their service for free here: http://i7n.co/2amnh

  • Donna

    Saturday, 07 May, 2016 03:30 PM

    Hello, I tried calling you several times today, and I'm not getting through for some reason. If your website does not have many Facebook Likes, why would someone visit your Facebook Fanpage? People Like you when other people like you. The more people that LIKE your website and fanpage on Facebook, the more credibility you will have with new visitors. It works the same for Twitter, Instagram and Youtube. When people visit your page and see that you have a lot of followers, they now want to follow you too. They too want to know what all the hype is and why all those people are following you. Get some free likes, followers, and views just for trying this service I found: http://mariowelte.de/6y5j

  • Emily

    Monday, 02 May, 2016 04:56 PM

    Hello my name is Emily and I just wanted to drop you a quick message here instead of calling you. I discovered your Rename Folder and File in C#, ASP.Net -TheOneblogs.com website and noticed you could have a lot more traffic. I have found that the key to running a popular website is making sure the visitors you are getting are interested in your subject matter. There is a company that you can get keyword targeted visitors from and they let you try their service for free for 7 days. I managed to get over 300 targeted visitors to day to my website. Visit them here: http://sirrico.net/yourls/p7j6

  • asgavyleg705

    Saturday, 16 April, 2016 01:35 PM

    Nice .. Thank you

  • asgavyev8d4o

    Saturday, 16 April, 2016 10:56 AM

    Helping..

  • Natalie

    Tuesday, 05 April, 2016 09:35 AM

    I was just looking at your Rename Folder and File in C#, ASP.Net -TheOneblogs.com site and see that your website has the potential to become very popular. I just want to tell you, In case you don't already know... There is a website service which already has more than 16 million users, and the majority of the users are looking for topics like yours. By getting your website on this network you have a chance to get your site more visitors than you can imagine. It is free to sign up and you can find out more about it here: http://sirrico.net/yourls/p5sk - Now, let me ask you... Do you need your website to be successful to maintain your business? Do you need targeted visitors who are interested in the services and products you offer? Are looking for exposure, to increase sales, and to quickly develop awareness for your website? If your answer is YES, you can achieve these things only if you get your website on the service I am describing. This traffic service advertises you to thousands, while also giving you a chance to test the network before paying anything. All the popular blogs are using this network to boost their traffic and ad revenue! Why aren’t you? And what is better than traffic? It’s recurring traffic! That's how running a successful website works... Here's to your success! Find out more here: http://yxbp.com/2m6y

  • bizimambar

    Wednesday, 02 March, 2016 08:55 PM

    I really love your site.. Great colors & theme. Did you make this amazing site yourself? Please reply back as I’m attempting to create my own site and would love to learn where you got this from or exactly what the theme is called. Thank you!| http://www.bizimambar.com

  • Donna

    Friday, 13 November, 2015 05:43 PM

    Hi my name is Donna and I just wanted to drop you a quick note here instead of calling you. I discovered your Rename Folder and File in C#, ASP.Net -TheOneblogs.com page and noticed you could have a lot more traffic. I have found that the key to running a popular website is making sure the visitors you are getting are interested in your subject matter. There is a company that you can get targeted visitors from and they let you try their service for free for 7 days. I managed to get over 300 targeted visitors to day to my site. Check it out here: http://garye.co/s6

Leave a comment

Name
E-mail
Url
Message

Get More Stuff
Subscribing to the TheOneblogs newsletter and get intersting stuff and updates to your email inbox.
Your Email

 

Style Switcher

Change Color

×! We use cookies to improve your user experience. More information