Re: I could not use it in window service by c# - WeOnlyDo Discussion board

Re: I could not use it in window service by c# (General questions)

by yinpengxiang, Thursday, August 20, 2009, 17:19 (5575 days ago) @ wodDamir

Hi,
At first I used wodFtpDLX.net component but wodFtpDLX, now I have changed to the Com component --- wodFtpDLX; It has not the chinese problem; thanks.
but I found a problem of ftp.RemotePath property, the following is my code, if have no the following code the ftp.RemotePath property value maybe /s/../s/a/.. , so has any other way I can get the real path like /s but /s/../s/a/.. .

My code:

string sRemote = ;
List<string> folderList = new List<string>();
string[] folders = ftp.RemotePath.Split('/');
for (int i = folders.Length - 1; i >= 0; )
{
if (folders == )
{
}
else if (folders == .. )
{
i--;
}
else
{
folderList.Add(folders);
}
i--;
}
for (int j = folderList.Count - 1; j >= 0; j--)
{
sRemote = sRemote + / + folderList[j];
}
if (sRemote == )
{
ftp.RemotePath = / ;
}
else
{
ftp.RemotePath = sRemote;
}

thanks


Complete thread: