请教怎么样在后台判断dwg文件可写
www.dimcax.com
请教怎么样在后台判断dwg文件可写
请教高手,我要写一个后台的批处理,最后需要保存我要怎么判断需要处理的dwg文件没有被锁定或只读?如果只读的话就不处理
代码: using system; using system.io; class testrw { public static void main(string[] args) { filestream fs = new filestream("xxxx.dwg文件", filemode.openorcreate, fileaccess.write); if (fs.canread && fs.canwrite) { console.writeline("myfile.txt can be both written to and read from."); } else if (fs.canwrite) { console.writeline("myfile.txt is writable."); } } }
可以这样直接读取文件判断dwg文件啊?谢谢啊 cad自己没有函数吗?
你加'using system.io; '就可以了. 不就是 filestream fs = new filestream("xxxx.dwg文件", filemode.openorcreate, fileaccess.write); if (fs.canread && fs.canwrite) { ........................... } else if (fs.canwrite) { .............................. }
我的意思的cad自己的方法里面没有判断的吗?比如map读取的时候会有一个dwl文件提示锁定了dwg