catinhatlib.cs

来自「客户关系管理系统ASP.NET+VB.NET编程完整程序!」· CS 代码 · 共 56 行

CS
56
字号
//This file is part of ORM.NET.
//
//ORM.NET is free software; you can redistribute it and/or
//modify it under the terms of the GNU Lesser General Public
//License as published by the Free Software Foundation; either
//version 2.1 of the License, or (at your option) any later version.
//
//ORM.NET is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//Lesser General Public License for more details.
//
//You should have received a copy of the GNU Lesser General Public
//License along with ORM.NET; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


using System;
using System.Resources;
using System.Reflection;
using System.IO;
using System.Xml.Serialization;
using System.Text;
using System.Net;

using ORMBiz;
using OrmLib;

namespace ORM.NET
{
	/// <summary>
	/// Summary description for OrmLibGenerator.
	/// </summary>
	public class OrmLibGenerator
	{
		public OrmLibGenerator(){}

		public string Generate(Database db)
		{
			XmlSerializer serializer = new XmlSerializer(typeof(byte[]));
			StringBuilder sb = new StringBuilder();
			StringWriter sw = new StringWriter(sb);

			//serializer.Serialize(sw,FileTools.ToByteArray( Assembly.GetAssembly(typeof(OrmLib.BusinessBase)).Location ));
			serializer.Serialize(sw,FileTools.ToByteArray( Directory.GetParent( Assembly.GetEntryAssembly().Location ) + @"\OrmLib.dll" ));
			
			//System.Net.WebClient client = new WebClient();
			//byte[] data = client.DownloadData("http://service.ormnet.com/ormservice/ui/OrmLib.dll");
			//serializer.Serialize(sw,data);

			sw.Close();
			return sb.ToString();
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?