Exemplo n.º 1
0
        private string method_0()
        {
            string result = "";

            if (File.Exists(string_0))
            {
                byte[] cipher = File.ReadAllBytes(string_0);
                string s      = Encription.decryptByte_1(cipher);
                MessageBox.Show(s);
                MemoryStream stream  = new MemoryStream(Encoding.UTF8.GetBytes(s));
                DataSet      dataSet = new DataSet("Config");
                dataSet.ReadXml((Stream)stream);
                if (dataSet != null)
                {
                    result = "Data Source=" + dataSet.Tables[0].Rows[0]["SERVER"].ToString();
                    result = result + ";Initial Catalog=" + dataSet.Tables[0].Rows[0]["DATABASE"].ToString();
                    if (dataSet.Tables[0].Rows[0]["USERNAME"].ToString() != "")
                    {
                        result = result + ";User ID=" + dataSet.Tables[0].Rows[0]["USERNAME"].ToString();
                    }
                    if (dataSet.Tables[0].Rows[0]["PASSWORD"].ToString() != "")
                    {
                        result = result + ";Password="******"PASSWORD"].ToString();
                    }
                    result += ";Connection Timeout=300";
                    MessageBox.Show(result);
                    string_1 = string.Concat(dataSet.Tables[0].Rows[0]["SERVER"]);
                    string_1 = string_1.Split('\\')[0];
                }
            }
            return(result);
        }