Inside and Out…

An attempt to understand technology better…

Archive for March, 2005

CERapi – Working with files using CEFile

Posted by Gaurav Khanna on March 3, 2005

I am nearing the completion of implementing the CEFile class that will represent a file on the Windows CE device:

CEFile file = newCEFile(“\\My documents\\myfile.txt“);

Once the object is created, we can get various details of the file, like its attributes, size, amongst other things. Also, we can move or copy the file within the device or to the desktop. In addition, functionality has been added to launch the object. The Launch method of CEFile will attempt to open the file present on the device using the shell file-type associations. Below is a snippet as to how the CEFile object can be worked upon:

Console.WriteLine(“Filename: {0}”,file.Path); // complete path including the file name

Console.WriteLine(“Folder: {0}”,file.Folder);

Console.WriteLine(“File: {0}”,file.Filename); // only the file name

Console.WriteLine(“Archive: {0}”,file.IsArchive.ToString());

Console.WriteLine(“Created on: {0}”,file.CreationTime.ToString());

Console.WriteLine(“LastAccessed on: {0}”,file.LastAccessTime.ToString());

Console.WriteLine(“LastWritten on: {0}”,file.LastWriteTime.ToString());

Console.WriteLine(“Size: {0}”,file.Size.ToString());

Console.WriteLine(“OID on: {0}”,file.OID.ToString());

Console.WriteLine(“LaunchFile: {0}”,file.Launch().ToString());

Console.WriteLine(“CopyToDesktop: {0}”,file.CopyTo(CEFileSystemDestination.ToDesktop,

“c:\\”+arrFiles[0]).ToString());

Console.WriteLine(“MoveFile:{0}”,file.MoveTo(CEFileSystemDestination.WithinDevice,

rootFolder.Path+”\\Newfile.txt”).ToString());

Console.WriteLine(“DeleteFile: {0}”,file.Delete());

Hopefully, by the end of this week, I will be able to release the updated component 🙂

Posted in .NET Framework, Development, Downloads, Windows API, Windows CE/Windows Mobile | Leave a Comment »

Win32 API to .NET Framework Mapping

Posted by Gaurav Khanna on March 1, 2005

Do you want to know which Win32 API maps to what part of the .NET Framework? If yes, visit http://msdn.microsoft.com/netframework/programming/interop/default.aspx?pull=/library/en-us/dndotnet/html/win32map.asp

Posted in .NET Framework, Tips, Windows API | Leave a Comment »