The windows mobile 5.0 SDK for pocket PC, had great dlls.
most popular one is the MicroSoft.Windows.Mobile.State.this is one have more than 100+ properties for Windows Mobile devices.You can download it's freely from here http://www.microsoft.com/downloads/details.aspx?familyid=83A52AF2-F524-4EC5-9155-717CBE5D25ED&displaylang=en
after installed SDK, create a new project with Windows Mobile 5.0 SDK Pocket PC, like this and give any name to your project.
before write code we want to add windows mobile dll to project as references, so select Reference menu in your Project and go to .net tab(default), there can u see 5 dll like start name Microsoft windows mobile... Please select M.W.M and M.W.M.State and give ok, after return to your code window.
Note(M.W.M -Microsoft.windows.mobile)
write code like following code snippet. or copy and paste and change namespace to your project name
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsMobile.Status;
using System.Net;
using System.IO;
using System.Diagnostics;
namespace InterNet
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
bool _remoteServerReachable = false;
bool _internetReachable = false;
bool _networkConnected = false;
private void Form1_Load(object sender, EventArgs e)
{
_networkWatcher = new SystemState(SystemProperty.ConnectionsCount, false);
_networkWatcher.Changed += new ChangeEventHandler(NetworkWatcher_Changed);
DetermineNetworkState(SystemState.ConnectionsCount);
DisplayConnectionInfo();
}
private void Form1_Closing(object sender, CancelEventArgs e)
{
// When creating an instance of the SystemState class that runs on a background thread,
// you must call the Dispose method to cause the background thread to exit.
if (_networkWatcher != null)
_networkWatcher.Dispose();
}
SystemState _networkWatcher = null;
void NetworkWatcher_Changed(object sender, ChangeEventArgs args)
{
int connectionsCount = (int)args.NewValue;
DetermineNetworkState(connectionsCount);
DisplayConnectionInfo();
}
static Uri _remoteServerUrl = new Uri(@"http://somebogusurlthatwontexist.com/SQLSync/sqlcesa30.dll");
// static Uri _remoteServerUrl = new Uri(@"http://192.168.1.102/SQLSync/sqlcesa30.dll");
const string _remoteServerExpectedText = @"SQL Server";
static Uri _internetReachableUrl = new Uri(@"http://mobile.live.com/search");
const string _internetReachableExpectedText = @"Live Search";
void DetermineNetworkState(int connectionsCount)
{
if (connectionsCount > 0)
{
_networkConnected = true;
_remoteServerReachable = IsUrlReachable(_remoteServerUrl, _remoteServerExpectedText);
_internetReachable = _remoteServerReachable ? true :
IsUrlReachable(_internetReachableUrl, _internetReachableExpectedText);
}
else
{
_networkConnected = false;
_internetReachable = false;
_remoteServerReachable = false;
}
}
void DisplayConnectionInfo()
{
if (InvokeRequired)
{
Invoke((MethodInvoker)DisplayConnectionInfo);
}
else
{
txtNetworkConnected.Text = _networkConnected.ToString();
txtRemoteServerReachable.Text = _remoteServerReachable.ToString();
txtInternetReachable.Text = _internetReachable.ToString();
}
}
#if PocketPC || Smartphone
// Required for the above Invoke call
// This delegate is already defined in the full .NET Framework
delegate void MethodInvoker();
#endif
const int _maxConnectTryCount = 2;
const int _sleepTimeBetweenConnectTries = 100; // milliseconds
bool IsUrlReachable(Uri url, string expectedText)
{
bool isUrlReachable = false;
HttpWebRequest httpRequest = null;
HttpWebResponse httpResponse = null;
Stream responseStream = null;
StreamReader responseReader = null;
for (int connectTryCount = 0;
!isUrlReachable && connectTryCount < httprequest =" (HttpWebRequest)WebRequest.Create(url);" method = "GET" httpresponse =" (HttpWebResponse)httpRequest.GetResponse();" responsestream =" httpResponse.GetResponseStream();" responsereader =" new" responsetext =" responseReader.ReadToEnd();" isurlreachable =" expectedText">= 0;
}
catch (SystemException ex)
{
// write log
#if DEBUG
Debug.WriteLine("");
Debug.WriteLine(string.Format("Try:{0} | Url:{1}",
connectTryCount.ToString(), url.ToString()));
Debug.WriteLine(ex.Message);
Debug.WriteLine("");
#endif
}
finally
{
if (responseReader != null)
responseReader.Close();
if (responseStream != null)
responseStream.Close();
if (httpResponse != null)
httpResponse.Close();
}
if (!isUrlReachable)
System.Threading.Thread.Sleep(_sleepTimeBetweenConnectTries);
}
return isUrlReachable;
}
}
}
from and video demo http://msdn2.microsoft.com/en-us/netframework/bb851561.aspx
and i would like to say thanks to Jim wilson.
I think you all are happy with WM 5.0 and WM 6.0
will next articles
-RRave
Tuesday, November 20, 2007
Tuesday, November 6, 2007
LINQ
Hi Guys
u all heard about LINQ, it's a quite development features for query structured development
see follow link and get more informations.
http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx
thanks
u all heard about LINQ, it's a quite development features for query structured development
see follow link and get more informations.
http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx
thanks
VS 2008 Beta 2
Hi guy
You can downland VS 2008 beta 2 version below link
http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx
http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx
And one good news for all VS 2008 final version will be release end of this November 2007 feel happy and expect more features in Vs 2008
Thanks
You can downland VS 2008 beta 2 version below link
http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx
http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx
And one good news for all VS 2008 final version will be release end of this November 2007 feel happy and expect more features in Vs 2008
Thanks
The New features in .Net Compact Framework 3.5
The .NET Compact Framework team has spent the last year planning and developing the next version of the .NET Compact Framework 3.5, which will align with the .NET Framework 3.5 shipping in next version of Visual Studio code named “Orcas”. The team has focused its efforts in 4 areas including, addressing core problems of creating distributed mobile applications by enabling mobile devices to interoperate with Windows Communication Foundation services, Implementing device specific features from LINQ, continuing to implement highly requested features and refining NETCF’s ability to diagnose and solve reliability and supportability issues.
The first release of NETCF 3.5 went public a few weeks ago in the Orcas January CTP. This release of NETCF does not include the complete list of features but is a step toward the final feature set. New builds of NETCF will be included in each new public drop of Orcas with the majority of features being included by Orcas Beta1. Below is a list of features included in the January CTP. If you’re interested in these new features start by downloading the Orcas January CTP using either the VPC image at http://www.microsoft.com/downloads/details.aspx?FamilyId=1FF0B35D-0C4A-40B4-915A-5331E11C39E6&displaylang=en or try installing it to your test PC at http://www.microsoft.com/downloads/details.aspx?FamilyId=69055927-458B-4129-9047-FCC4FACAE96C&displaylang=en
New Features Included in the Orcas January CTP:
• System.IO.Compression support, including support for HTTP compression.
• Support for a subset of Linq’s Standard Query Operators.
• SoundPlayer support using WaveOut allowing for multiple sounds to play at once.
• New API in Microsoft.WindowsCE.Forms for easily distinguishing Smartphone and Pocket PC.
• Allow Nested FuncEval's.
• Enhanced logging for interop functionality with native code.
• Stack Trace Enhancements.
• GAC Improvements.
• Allow for StrongName keys greater than 1024 long.
• To improved logging of finalizer activities to enhance product supportability.
• Allow log files to be read at runtime.
The first release of NETCF 3.5 went public a few weeks ago in the Orcas January CTP. This release of NETCF does not include the complete list of features but is a step toward the final feature set. New builds of NETCF will be included in each new public drop of Orcas with the majority of features being included by Orcas Beta1. Below is a list of features included in the January CTP. If you’re interested in these new features start by downloading the Orcas January CTP using either the VPC image at http://www.microsoft.com/downloads/details.aspx?FamilyId=1FF0B35D-0C4A-40B4-915A-5331E11C39E6&displaylang=en or try installing it to your test PC at http://www.microsoft.com/downloads/details.aspx?FamilyId=69055927-458B-4129-9047-FCC4FACAE96C&displaylang=en
New Features Included in the Orcas January CTP:
• System.IO.Compression support, including support for HTTP compression.
• Support for a subset of Linq’s Standard Query Operators.
• SoundPlayer support using WaveOut allowing for multiple sounds to play at once.
• New API in Microsoft.WindowsCE.Forms for easily distinguishing Smartphone and Pocket PC.
• Allow Nested FuncEval's.
• Enhanced logging for interop functionality with native code.
• Stack Trace Enhancements.
• GAC Improvements.
• Allow for StrongName keys greater than 1024 long.
• To improved logging of finalizer activities to enhance product supportability.
• Allow log files to be read at runtime.
Thanks
New features in .Net Framework 3.5
Faster .NET Framework execution
1. Faster garbage collection
2. Smarter, faster NGen requiring smaller working set RAM
3. 64 bit client improvements
4. ThreadPool performance improvements
5. Security check caching during NGen
Base Class Library – New Class Additions
6. BigInteger, HashSet and DateTime2 types
7. NSA Suite ”B” and FIPs compliant cryptography
8. Lightweight Reader/Writer Lock Classes
9. Anonymous and Named Pipes IO Classes
10. Integration with Event Tracing for Windows
11. New Addin hosting model for extensibility
Language Integrated Query (LINQ)
Deep integration of LINQ data-awareness into the programming languages and framework.
Workflow Enabled Services – Process and Messaging together
Using workflow to provide for durable and long-running services. New Tools, WF activities and new programming model classes have been added to simplify building workflow-enabled services using WF and WCF. This allows a .NET Framework developer to build business logic for a service using WF and expose messaging from that service using WCF. These improvements not only provide tools for this scenario but they reduce the amount of glue code that was previously required.
Web 2.0 Friendly and AJAX Enabled WCF Services
Ajax is a web development technique for making asynchronous exchanges of small amounts of data between browser and web service calls from the browser client script to the web server. A programming model is provided for building Ajax style web applications using WCF services. An HTTP programming model is also provided allowing for REST style web services.
Visual Studio Developer Tools for WF, WCF and in Visual Studio “Orcas”
Visual Studio”Orcas” has built in tools for web service authoring with WCF and for building workflow enabled software with WF. There are new project templates for WCF services, WF business logic, workflow enabled services, and AJAX services. The templates are conveniently set up to compile and run even before any custom code is added enabling .NET developers to get going quickly. There are also numerous other tools for developing with WF, WCF and WPF.
More WS-* Standards Support
Implementation in WCF of the latest OASIS specifications Web Services Atomic Transaction (WS-AtomicTransaction) 1.1, WS-ReliableMessaging 1.1, WS-SecureCOnversation and Web Services Coordination (WS-Coordination) 1.1.
RSS and ATOM Syndication API
Applications built using WCF will be able to easily expose syndicated data which can be consumed by an RSS or ATOM reader.
Partial Trust Support for WCF Hosting
Partial trust on the vlient is provided for ASMX parity focussing mainly on partially trusted WCF applications deployed through click-once. Support is provided for basic HTTP binding provided that the application runs in the Intranet zone and have granted the apropriate WebPermission. Secure communication is possible through transport security only. All other features are not available to partially trusted applications including hosting services, duplex communications, non-HTTP transports, WS-* protocols and any WF use.
Rules Data Improvements
The rules engine in WF is improved to add support for C# 3.0 extension metods, and for operator overloading . Also the ”new” operator is added to compete the base set of expression types.
Built-in WPF tools for Visual Studio “Orcas”
The Visual Studio designer for WPF was previously released as a CTP. It is not integrated into the development environment and is significantly improved.
Additional WPF Features and Improved Performance
WPF has smoother animations, faster startup and better overall performance. There are also new data types available for data binding with LINQ. Better integration support is now provided for with codename “WPF/E”.
thanks
1. Faster garbage collection
2. Smarter, faster NGen requiring smaller working set RAM
3. 64 bit client improvements
4. ThreadPool performance improvements
5. Security check caching during NGen
Base Class Library – New Class Additions
6. BigInteger, HashSet and DateTime2 types
7. NSA Suite ”B” and FIPs compliant cryptography
8. Lightweight Reader/Writer Lock Classes
9. Anonymous and Named Pipes IO Classes
10. Integration with Event Tracing for Windows
11. New Addin hosting model for extensibility
Language Integrated Query (LINQ)
Deep integration of LINQ data-awareness into the programming languages and framework.
Workflow Enabled Services – Process and Messaging together
Using workflow to provide for durable and long-running services. New Tools, WF activities and new programming model classes have been added to simplify building workflow-enabled services using WF and WCF. This allows a .NET Framework developer to build business logic for a service using WF and expose messaging from that service using WCF. These improvements not only provide tools for this scenario but they reduce the amount of glue code that was previously required.
Web 2.0 Friendly and AJAX Enabled WCF Services
Ajax is a web development technique for making asynchronous exchanges of small amounts of data between browser and web service calls from the browser client script to the web server. A programming model is provided for building Ajax style web applications using WCF services. An HTTP programming model is also provided allowing for REST style web services.
Visual Studio Developer Tools for WF, WCF and in Visual Studio “Orcas”
Visual Studio”Orcas” has built in tools for web service authoring with WCF and for building workflow enabled software with WF. There are new project templates for WCF services, WF business logic, workflow enabled services, and AJAX services. The templates are conveniently set up to compile and run even before any custom code is added enabling .NET developers to get going quickly. There are also numerous other tools for developing with WF, WCF and WPF.
More WS-* Standards Support
Implementation in WCF of the latest OASIS specifications Web Services Atomic Transaction (WS-AtomicTransaction) 1.1, WS-ReliableMessaging 1.1, WS-SecureCOnversation and Web Services Coordination (WS-Coordination) 1.1.
RSS and ATOM Syndication API
Applications built using WCF will be able to easily expose syndicated data which can be consumed by an RSS or ATOM reader.
Partial Trust Support for WCF Hosting
Partial trust on the vlient is provided for ASMX parity focussing mainly on partially trusted WCF applications deployed through click-once. Support is provided for basic HTTP binding provided that the application runs in the Intranet zone and have granted the apropriate WebPermission. Secure communication is possible through transport security only. All other features are not available to partially trusted applications including hosting services, duplex communications, non-HTTP transports, WS-* protocols and any WF use.
Rules Data Improvements
The rules engine in WF is improved to add support for C# 3.0 extension metods, and for operator overloading . Also the ”new” operator is added to compete the base set of expression types.
Built-in WPF tools for Visual Studio “Orcas”
The Visual Studio designer for WPF was previously released as a CTP. It is not integrated into the development environment and is significantly improved.
Additional WPF Features and Improved Performance
WPF has smoother animations, faster startup and better overall performance. There are also new data types available for data binding with LINQ. Better integration support is now provided for with codename “WPF/E”.
thanks
Subscribe to:
Posts (Atom)