static public bool FileExist(string filename) { DM_FILE_ATTRIBUTES att = new DM_FILE_ATTRIBUTES(); XboxGetFileAttributes(filename, ref att); if (att.ChangeTime.dwHighDateTime != 0 || att.ChangeTime.dwLowDateTime != 0 || att.CreationTime.dwHighDateTime != 0 || att.CreationTime.dwLowDateTime != 0 || att.SizeHigh > 0 || att.SizeLow > 0 ) { return(true); } return(false); //return (att.SizeHigh != 0 && att.SizeLow != 0); //bool exist = XboxFileExist(filename); //return exist; }
static extern bool XboxGetFileAttributes(string name, ref DM_FILE_ATTRIBUTES pAttributes);
static public bool GetFileAttributes(string name, ref DM_FILE_ATTRIBUTES pAttributes) { XboxGetFileAttributes(name, ref pAttributes); return(Marshal.GetLastWin32Error() != 0); }