Click here to Skip to main content
15,921,351 members
Home / Discussions / C#
   

C#

 
QuestionSocket security Pin
yesu prakash19-Feb-09 17:19
yesu prakash19-Feb-09 17:19 
AnswerRe: Socket security Pin
cmk19-Feb-09 19:52
cmk19-Feb-09 19:52 
GeneralRe: Socket security Pin
yesu prakash19-Feb-09 20:20
yesu prakash19-Feb-09 20:20 
QuestionHow can i know which key value(which is an int value) is the smallest or highest in c#? Pin
merryjoy00019-Feb-09 17:14
merryjoy00019-Feb-09 17:14 
AnswerRe: How can i know which key value(which is an int value) is the smallest or highest in c#? Pin
Luc Pattyn19-Feb-09 17:52
sitebuilderLuc Pattyn19-Feb-09 17:52 
QuestionHow can i get the highest value in a hash table using c# Pin
merryjoy00019-Feb-09 16:56
merryjoy00019-Feb-09 16:56 
AnswerRe: How can i get the highest value in a hash table using c# Pin
Calin Tatar19-Feb-09 22:21
Calin Tatar19-Feb-09 22:21 
QuestionFTP Parse LIST Command Pin
User 572816019-Feb-09 16:46
User 572816019-Feb-09 16:46 
I have been trying to parse the Directory list into usable information.
For example if I am given the following:
-rw-r--r-- 1 ftp ftp 87040 Feb 17 23:46 Test_test Resume_Full.doc
The problem is how to know what is what. I can't parse/split based on a space " " because what happens is the date is seperated on spaces as well as the file names.

Can anybody help me?

Code Information below: In the code below the method "ExecuteCommand" just gets the response from the server.

------------------------------CODE BLOCK----------------------------------
Socket l_ClientDataSocket = null;
int l_iDataPort;
TcpListener l_FTPListener = null;
Byte[] l_bRecvData = new Byte[5120];
int l_iBufferLimit = 5119;
FileStream l_fsOutFile = null;
BinaryWriter l_fbOutFile = null;
string l_strCommand = "";
StringCollection l_strOutput = new StringCollection();
int l_iRetval = 0;

l_FTPListener = new TcpListener(0);
l_FTPListener.Start();
IPEndPoint pt = (IPEndPoint)l_FTPListener.LocalEndpoint;
l_iDataPort = pt.Port;

string l_strPortParams = GetPortParameters(l_iDataPort);
string l_strPortCommand = "PORT " + l_strPortParams + "\r\n";
l_iRetval = ExecuteCommand(l_strPortCommand, ref l_strOutput);

l_strCommand = "LIST " + l_strCurrDir + "\r\n";
l_iRetval = ExecuteCommand(l_strCommand, ref l_strOutput);

Thread.Sleep(500);
if (l_FTPListener.Pending())
{
l_ClientDataSocket = l_FTPListener.AcceptSocket();
}

l_ClientDataSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, RecvTimeOut);
l_ClientDataSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, SendTimeOut);
l_bRecvData.Initialize();
l_strOutput = new StringCollection();
l_iRetval = 0;

string l_strTemp = "";
Thread.Sleep(1000);
for (; l_ClientDataSocket.Available > 0; )
{
l_bRecvData.Initialize();
l_iRetval = l_ClientDataSocket.Receive(l_bRecvData, l_iBufferLimit, 0);
l_strTemp = Encoding.ASCII.GetString(l_bRecvData, 0, l_iRetval);
Thread.Sleep(400);
}

if (l_FTPListener != null)
{
l_FTPListener.Stop();
l_FTPListener = null;
}

modified 13-Feb-19 21:02pm.

QuestionSPList and FileNotFoundException Pin
Not Active19-Feb-09 16:02
mentorNot Active19-Feb-09 16:02 
Questionc# code to count ,how many times a method is called? Pin
merryjoy00019-Feb-09 16:01
merryjoy00019-Feb-09 16:01 
AnswerRe: c# code to count ,how many times a method is called? Pin
Richard Andrew x6419-Feb-09 16:23
professionalRichard Andrew x6419-Feb-09 16:23 
QuestionUpdate only changed record. Pin
hdv21219-Feb-09 12:38
hdv21219-Feb-09 12:38 
AnswerRe: Update only changed record. Pin
Mycroft Holmes19-Feb-09 13:41
professionalMycroft Holmes19-Feb-09 13:41 
GeneralRe: Update only changed record. Pin
hdv21219-Feb-09 13:48
hdv21219-Feb-09 13:48 
GeneralRe: Update only changed record. Pin
Mycroft Holmes19-Feb-09 14:07
professionalMycroft Holmes19-Feb-09 14:07 
Questiondoubt about collections. Pin
Kishor Boddu19-Feb-09 11:40
Kishor Boddu19-Feb-09 11:40 
AnswerRe: doubt about collections. Pin
Ennis Ray Lynch, Jr.19-Feb-09 12:30
Ennis Ray Lynch, Jr.19-Feb-09 12:30 
QuestionHow get html source code of WebPage? Pin
aleXXXka19-Feb-09 11:17
aleXXXka19-Feb-09 11:17 
AnswerRe: How get html source code of WebPage? Pin
Luc Pattyn19-Feb-09 11:31
sitebuilderLuc Pattyn19-Feb-09 11:31 
GeneralRe: How get html source code of WebPage? Pin
aleXXXka19-Feb-09 12:44
aleXXXka19-Feb-09 12:44 
GeneralRe: How get html source code of WebPage? Pin
vaghelabhavesh19-Feb-09 13:07
vaghelabhavesh19-Feb-09 13:07 
GeneralRe: How get html source code of WebPage? Pin
aleXXXka22-Feb-09 7:50
aleXXXka22-Feb-09 7:50 
Questionupdating a label from a thread in a different class Pin
liamderice19-Feb-09 10:59
liamderice19-Feb-09 10:59 
AnswerRe: updating a label from a thread in a different class Pin
DaveyM6919-Feb-09 11:12
professionalDaveyM6919-Feb-09 11:12 
GeneralRe: updating a label from a thread in a different class Pin
liamderice20-Feb-09 4:48
liamderice20-Feb-09 4:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.