Exemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="configureFileName"></param>
        /// <returns></returns>
        public static ConfigureInfosStrcut LoadConfigureInfos(string configureFileName)
        {
            ConfigureInfosStrcut oResult = new ConfigureInfosStrcut();
            SoapFormatter oXmlFomatter = new SoapFormatter();

            System.IO.FileStream oFileStream = new System.IO.FileStream(configureFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read);
            oResult = (ConfigureInfosStrcut)oXmlFomatter.Deserialize(oFileStream);

            oFileStream.Close();
            return oResult;
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="configureFileName"></param>
        /// <returns></returns>
        public static ConfigureInfosStrcut LoadConfigureInfos(string configureFileName)
        {
            ConfigureInfosStrcut oResult      = new ConfigureInfosStrcut();
            SoapFormatter        oXmlFomatter = new SoapFormatter();

            System.IO.FileStream oFileStream = new System.IO.FileStream(configureFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read);
            oResult = (ConfigureInfosStrcut)oXmlFomatter.Deserialize(oFileStream);

            oFileStream.Close();
            return(oResult);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="informations"></param>
        /// <param name="savePath"></param>
        public static void SaveConfigureInfos(ConfigureInfosStrcut informations, string savePath)
        {
            SoapFormatter oXmlFormatter = new SoapFormatter();
            System.IO.MemoryStream oMemStream = new System.IO.MemoryStream();

            oXmlFormatter.Serialize(oMemStream, informations);

            System.IO.FileStream oFileStream = new System.IO.FileStream(savePath, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);

            byte[] oBytes = oMemStream.GetBuffer();
            oFileStream.Write(oBytes, 0, oBytes.Length);

            oFileStream.Close();
        }
Exemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="informations"></param>
        /// <param name="savePath"></param>
        public static void SaveConfigureInfos(ConfigureInfosStrcut informations, string savePath)
        {
            SoapFormatter oXmlFormatter = new SoapFormatter();

            System.IO.MemoryStream oMemStream = new System.IO.MemoryStream();

            oXmlFormatter.Serialize(oMemStream, informations);

            System.IO.FileStream oFileStream = new System.IO.FileStream(savePath, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);

            byte[] oBytes = oMemStream.GetBuffer();
            oFileStream.Write(oBytes, 0, oBytes.Length);

            oFileStream.Close();
        }