Esempio n. 1
0
        public static string GetWebStatusCodeString(FtpStatusCode statusCode, string statusDescription)
        {
            string webStatusCode = "(" + ((int)statusCode).ToString(NumberFormatInfo.InvariantInfo) + ")";
            string statusMessage = null;

            //
            // Now combine the label with the base enum key and look up the status msg.
            //
            try {
                //
                // convert the HttpStatusCode to its label and look it up.
                //
                statusMessage = SR.GetString("net_ftpstatuscode_" + statusCode.ToString(), null);
            }
            catch {
            }

            if (statusMessage != null && statusMessage.Length > 0)
            {
                webStatusCode += " " + statusMessage;
            }
            else
            {
                //
                // Otherwise try to map the base status.
                //
                if (statusDescription != null && statusDescription.Length > 0)
                {
                    webStatusCode += " " + statusDescription;
                }
            }

            return(webStatusCode);
        }
 public static string GetWebStatusCodeString(FtpStatusCode statusCode, string statusDescription)
 {
     string str = "(" + ((int) statusCode).ToString(NumberFormatInfo.InvariantInfo) + ")";
     string str2 = null;
     try
     {
         str2 = SR.GetString("net_ftpstatuscode_" + statusCode.ToString(), (object[]) null);
     }
     catch
     {
     }
     if ((str2 != null) && (str2.Length > 0))
     {
         return (str + " " + str2);
     }
     if ((statusDescription != null) && (statusDescription.Length > 0))
     {
         str = str + " " + statusDescription;
     }
     return str;
 }
        public static string GetWebStatusCodeString(FtpStatusCode statusCode, string statusDescription)
        {
            string str  = "(" + ((int)statusCode).ToString(NumberFormatInfo.InvariantInfo) + ")";
            string str2 = null;

            try
            {
                str2 = SR.GetString("net_ftpstatuscode_" + statusCode.ToString(), (object[])null);
            }
            catch
            {
            }
            if ((str2 != null) && (str2.Length > 0))
            {
                return(str + " " + str2);
            }
            if ((statusDescription != null) && (statusDescription.Length > 0))
            {
                str = str + " " + statusDescription;
            }
            return(str);
        }
Esempio n. 4
0
        public static string GetWebStatusCodeString(FtpStatusCode statusCode, string statusDescription) {
            string webStatusCode = "(" + ((int)statusCode).ToString(NumberFormatInfo.InvariantInfo) + ")";
            string statusMessage = null;
            //
            // Now combine the label with the base enum key and look up the status msg.
            //
            try {
                //
                // convert the HttpStatusCode to its label and look it up.
                //
                statusMessage = SR.GetString("net_ftpstatuscode_" + statusCode.ToString(), null);
            }
            catch {
            }

            if (statusMessage!=null && statusMessage.Length>0) {
                webStatusCode += " " + statusMessage;
            }
            else {
                //
                // Otherwise try to map the base status.
                //
                if (statusDescription!=null && statusDescription.Length>0) {
                    webStatusCode += " " + statusDescription;
                }
            }

            return webStatusCode;
        }
Esempio n. 5
0
 private void ShowFTPResult(FtpStatusCode statusCode)
 {
     MessageBox.Show("The FTP Server returned the following status: " + statusCode.ToString(), "Simple FTP Client", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }