C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » .NET Framework »

.Net Compact Framework Programming


Posted Date: 09 Jul 2004    Resource Type: Articles    Category: .NET Framework
Author: sibish n bMember Level: Bronze    
Rating: 1 out of 5Points: 10



.Net Compact Framework programming is similar to that of .Net Full Framework. But as you work with it, you will face a lot of difficulties.

One of the difficulties i faced was in finding the pathname of a File or an Image. We can get the path using assembly. If a text file is included in the project,then we can obtain its path as follows:


string m_SourceImageFileName="test.txt";
String CodePath =System.Reflection.Assembly.GetExecutingAssembly().GetName ().CodeBase;
CodePath = CodePath.Substring(0, CodePath.LastIndexOf(@"\"));
m_SourceImageFileName =CodePath + @"\" + m_SourceImageFileName;
reader1=File.OpenText(m_SourceImageFileName);


here a text file "test.txt" is included in the project.

Thread programming is possible in .Net Compact Framework but there is no Thread.suspend(),Thread.abort(). We have only Thread.Start(), ie once a thread is started, we cannot stop or abort it. It will have to be exited automatically. In emulator, thread programming rarely works.

Asynchronous network I/O worked fine but Asynchronous file I/O didt work. I had to depend on Synchronous file I/O. I tried it only in emulator.

You can import a file into the emulator either by including the file in the project or by network file sharing. In the first case, when the project is deployed, the file will be downloaded into the emulator or device. In the latter case, we can do it by sharing the file.
After sharing, if you have only a single machine, you can test it by installing "Microsoft's Loop Host Adapter".

To Install "Loop Host Adapter", go to control panel, Add new hardware, Add a new Hardware Device,Network Adapters,Loop host Adapter. Once you install this, you can access shared files.

Before you view the shared files in emulator, go to "settings" in start menu in the emulator.(In "Microsoft Mobile Operating System", startmenu and task bar is on the top). In "settings", select "System" tab and tap "About". In that change the "Device ID" into a suitable name. Now Take "File Explorer" and click on the sharing button(button with a hand carrying a cylinder). Type your Computer Name and tap "connect". Enter your username and password. You can view your shared files.

To copy the files, press your left mouse button on the desired file for 5 seconds. You can see some "red spots" coming around your cursor. after 5 seconds, a copy/cut menu pops up. You can then change the directory and copy to the desired place.






Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Incrementing the serial number in Datagrid Columns
Previous Resource: How to encrypt and decrypt a string - a simple encryption/decryption
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use