Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Serial Communications
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00777081
Message ID:
00777109
Vues:
12
Hi Charles,

There is no support for serial ports in version 1.0 and 1.1 of the .NET Framework. However, here are some links to information about alternative ways to work with serial ports:

There are plans to add support for serial ports in a future version:
http://groups.google.com/groups?&selm=O%23vQLn9bCHA.392%40tkmsftngp09
Here is a sample similar to what they will be adding:
http://www.gotdotnet.com/community/usersamples/Default.aspx?query=SerialPort
(note, project built with beta VS.NET, read gotdotnet comment)

With 1.0/1.1 you have to use PInvoke or Interop :

First understand the Win32 API as described here (C++):
http://msdn.microsoft.com/library/en-us/dnfiles/html/msdn_serial.asp

MSDN article for .NET (mostly C#):
http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/

PInvoke samples for C#:
http://www.gotdotnet.com/community/usersamples/Default.aspx?query=SerialPort
http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/
http://www.gotdotnet.com/community/usersamples/Default.aspx?query=SerialStream

or for VB.NET:
http://msdn.microsoft.com/library/en-us/dnvssamp/html/vbcs_usingthecomportinvbnet.asp
http://www.gotdotnet.com/community/usersamples/Default.aspx?query=rs232
http://www.allapi.net/classlib/class.php?id=15

or you can use the "Managed Extensions for C++" and write wrappers.
http://msdn.microsoft.com/vstudio/techinfo/articles/upgrade/managedext.asp
http://www.gotdotnet.com/team/cplusplus/
on your VS.NET path:
...\VC7\managedextensionsspec.doc
...\VC7\migration_guide.doc
MC++ Sample:
http://www.codeproject.com/managedcpp/howtocomport.asp

or reusing the VB6 MSComm ActiveX is easy, but it has some 'problems' (license)
http://support.microsoft.com/?kbid=318597
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=320
http://ourworld.compuserve.com/homepages/richard_grier/NETCommOCX.htm

commercial:
http://www.sax.net/dotnet/communications/
http://www.winsoft.sk/ncomport.htm

for Compact Framework (Windows CE)
http://ourworld.compuserve.com/homepages/richard_grier/CFSerial.htm

for Interop, use newsgroup:
microsoft.public.dotnet.framework.interop


>Hi All,
>
>I have this RFID scanner connected to my COM port and would like to read from it using VB.NET. Can anyone point me where I can find documentation or readme's on this kind of project? Thanks All!
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform