Esempio n. 1
0
        /// <summary>
        /// �������ͻ�ȡ�汾��
        /// </summary>
        /// <param name="url">Զ��Ŀ¼�ĸ�Ŀ¼</param>
        /// <param name="systemType">���� 0 Fedoreϵͳ 1 Redhatϵͳ</param>
        /// <returns>��ǰ�İ汾��</returns>
        public static string GetVersion( int systemType)
        {
            string temp = string.Empty;
            if (systemType == 0)
            {
                temp = URL +  FEDORE+ "/version.txt";
            }
            else if (systemType == 1)
            {
                temp = URL + REDHAT + "/version.txt";
            }
            else if (systemType == 2)
            {
                temp = URL + WINDOWS + "/version.txt";
            }

            RemoteFile rf = new RemoteFile();

            byte[] bytes = rf.GetRemoteFileByteContent(temp);

            if (bytes == null)
                return null;

            string str = Encoding.Default.GetString(bytes);

            return str;
        }