C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




remote file system


Posted Date: 05 Sep 2008      Total Responses: 1

Posted By: kalaimanichozhan       Member Level: Gold     Points: 1


I want to get file name from remote system.If u have coding send me



Responses

Author: mythili d    05 Sep 2008Member Level: SilverRating:     Points: -20
this is the method I was using to copy images from a shared drive on a different machine in the network to a location I wanted into the folders I wanted. I this could help you get waht you wanted.
thanks

protected void CopyImage()
{






// DAImage da = new DAImage();
string stylenum = "";
int itemid = 0;
stylenum = "200899-01";
string filenum = "";
string newfilename = Guid.NewGuid().ToString () ;
int index = 0;
try
{

string[] files = System.IO.Directory.GetFiles(("\\\\Ccsrv2\\publicfiles\\All\\MARKETING\\Product Images\\Style Images\\August 2008 Market\\Test"));
//(@"C:\\Documents and Settings\\mduddebanda\\My Documents\\My Pictures\\DeleteFolder");


foreach (string file in files)
{
index = file.IndexOf(".");
filenum = file.Remove(index, 3);
index = file.Length;
filenum = file.Replace("\\", "");
index = filenum.Length;

filenum = filenum.Substring(index - 13, 9);

//filenum=file.Remove(index);
//Response.Write(filenum);
DataTable dtitem = DAImage.GetItembyStylenum(filenum);
foreach (DataRow dr in dtitem.Rows)
{
stylenum = (dr[0].ToString());
itemid = Convert.ToInt16(dr[1].ToString());
}


if (filenum == stylenum) // get the stylenum in the required format from the file here
{
//Get the image id for the image to be inserted into the table.
DataTable dt = DAImage.GetImageId();
string result = "";
foreach (DataRow dr in dt.Rows)
{
result = dr[0].ToString();
}



System.IO.Directory.CreateDirectory("D:\\devlibrary\\images\\tblItem" + itemid);
System.IO.File.Copy(file, "D:\\devlibrary\\images\\tblItem" + itemid + "\\" + newfilename + ".jpg");
DAImage.InsertImage("/tblItem" + itemid + "/" + newfilename + ".jpg", itemid);
System.IO.File.Delete(file);
}


}
}
catch (Exception ex)
{
throw ex;
}
}
}


Post Reply
You must Sign In to post a response.
Next : Validations in asp.net
Previous : doubts abt collections in C#.Net
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use