wallpaper

.net code

Request Object of ASP .NET related to Paths

Request Object

Here’s a list of the Path related properties on the Request object (and the Page object). Assume a path like http://www.avmendapara.com/wallpaper/admin/paths.aspx for the paths below where webstore is the name of the virtual.

here property of request object given

ApplicationPath :

Returns the web root-relative logical path to the virtual root of this app. /wallpaper/

PhysicalApplicationPath :

Returns local file system path of the virtual root for this app.
c:\inetpub\wwwroot\wallpaper

PhysicalPath

Returns the local file system path to the current script or path.
c:\inetpub\wwwroot\wallpaper\admin\paths.aspx

CurrentExecutionFilePath FilePath Path

All of these return the full root relative logical path to the script page including path and scriptname. /wallpaper/admin/paths.aspx

AppRelativeCurrentExecutionFilePath

Returns an ASP.NET root relative virtual path to the script or path
~/admin/paths.aspx

PathInfo

Returns any extra path following the script name. If no extra path is provided returns the root-relative path (returns text in red below). string.Empty if no PathInfo is available.
/wallpaper/admin/paths.aspx/ExtraPathInfo

RawUrl

Returns the full root relative relative URL including querystring and extra path as a string. /wallpaper/admin/paths.aspx?sku=wwhelp40

Url

Returns a fully qualified URL including querystring and extra path. Note this is a Uri instance rather than string. http://www.avmendapara.com/wallpaper/admin/paths.aspx?sku=wwhelp40

UrlReferrer

The fully qualified URL of the page that sent the request. This is also a Uri instance and this value is null if the page was directly accessed by typing into the address bar or using an HttpClient. Based Referrer client Http header. http://www.avmendapara.com/wallpaper/default.aspx?Info

Control.TemplateSourceDirectory

Returns the logical path to the folder of the page, master or user control on which it is called. This is useful if you need to know the path only to a Page or control from within the control. For non-file controls this returns the Page path. /wallpaper/admin/

As you can see there

Rename your all files located in one folder

rename files just use this code its rename all files which is located in your folder path

string dest;
string[] a = new string[5];
string b = Server.MapPath(”your folder path”);
a = Directory.GetFiles(b);

for (int i = 0; i < a.Length; i++)
{
FileInfo sos = new FileInfo(a[i].ToString());
//string c = a[i].ToString();
//source = a[i].ToString();
dest = b + “your new path”;
sos.MoveTo(dest);
}

Renaming In .net With C#

Renaming Your files using c# just copy and paste your code.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace rhozetApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private int File_Delete(string Filepath)
{
FileInfo fi = new FileInfo(Filepath);

if (fi.Exists)
{
fi.Delete();
}
return 1;
}

private int File_rename(string FilepathOld, string FilepathNew)
{
FileInfo fi = new FileInfo(FilepathOld);

if (fi.Exists)
{
fi.MoveTo(FilepathNew);

}
return 1;
}

private void button1_Click(object sender, EventArgs e)

{

FileInfo fi = new FileInfo(”C:\\dateiname.txt”);

if (fi.Exists)
{
fi.MoveTo(”C:\\dateiname.mpg”);
textBox1.Text = ” Succesfull! “;
}
else
{
textBox1.Text = ” Failed! “;
}
}
}}

in c# rename your files by coding just use this code