public server static void Main(args _args) { BinData binData = new BinData(); Container con; myClass myclass; FileIoPermission perm; Filename filename = "C:\\Sunset.jpg"; Filename tofilename = "D:\\1111.jpg"; ; perm = new FileIoPermission(tofilename, "w"); perm.assert(); con = myclass::GetFileDataOnClient(filename); binData.setData(con); binData.saveFile(tofilename); CodeAccessPermission::revertAssert(); }
public client static container GetFileDataOnClient(FileName _fileName) { BinData binData = new BinData(); FileIoPermission perm; ; if (WinAPI::fileExists(_filename)) { perm = new FileIoPermission(_filename,"r"); perm.assert(); binData.loadFile(_fileName); CodeAccessPermission::revertAssert(); return BinData.getData(); } return conNull(); }
没有评论:
发表评论