Пример #1
0
        public object addFromString(ScriptContext context, object localname, object contents)
        {
            string name = PHP.Core.Convert.ObjectToString(localname);

            this.m_zip.BeginUpdate();
            try
            {
                StringDataSource src = new StringDataSource(contents);
                this.m_zip.Add(src, name);
                this.m_zip.CommitUpdate();
                return(true);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("ZipArchive::addFromString", ex.Message);
                return(false);
            }
        }
Пример #2
0
        public object addFromString(ScriptContext context, object localname, object contents)
        {
            string name = PHP.Core.Convert.ObjectToString(localname);

            this.m_zip.BeginUpdate();
            try
            {
                StringDataSource src = new StringDataSource(contents);
                this.m_zip.Add(src, name);
                this.m_zip.CommitUpdate();
                return true;
            }
            catch (Exception ex)
            {
                Debug.WriteLine("ZipArchive::addFromString", ex.Message);
                return false;
            }
        }