问个简单问题
如何用.net程序编写“把当前打开的cad文件保存到硬盘中”
或者,如何把当前打开的cad文件保存中数据中以二进制的形式保存,谢谢。非常感谢,我是个菜鸟!!!!
自己顶!谁帮帮我呀 会用acad吗?
save后是dwg 保存为dxf,就是二进制文件 /// <summary>
/// //将转成二进制数据
/// </summary>
/// <param name="filepath">文件名</param>
/// <returns></returns>
public static Byte[] streamin(string filepath)
{
FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read);
Byte[] btye2 = new byte;
fs.Read(btye2, 0, Convert.ToInt32(fs.Length));
fs.Close();
return btye2;
}
/// <summary>
/// 将二进制数据转成
/// </summary>
/// <param name="bb"></param>
/// <param name="filepath"></param>
public static void streamout(byte[] bb, string filepath)
{
int ArraySize = bb.GetUpperBound(0);
FileStream fs = new FileStream(filepath, FileMode.OpenOrCreate, FileAccess.Write);
fs.Write(bb, 0, ArraySize);
fs.Close();
}
页:
[1]