Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / December 2005

Tip: Looking for answers? Try searching our database.

2.0 framework + visual studio 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
WIWA - 13 Dec 2005 21:40 GMT
Hi,

Just downloaded .NET 2.0 framework. However when I then launch MS Visual
Studio 2003, it seems like certain libraries from 2.0 are not recognized.
More specific, I'm trying the following code. Anyone knows I have to do
something else first?

using System;
using System.Net;
using System.Net.NetworkInformation;
using System.Text;

namespace Examples.System.Net.NetworkInformation.PingTest
{
   public class PingExample
   {
       // args[0] can be an IPaddress or host name.
       public static void Main (string[] args)
       {
           Ping pingSender = new Ping ();
           PingOptions options = new PingOptions ();

           // Use the default Ttl value which is 128,
           // but change the fragmentation behavior.
           options.DontFragment = true;

           // Create a buffer of 32 bytes of data to be transmitted.
           string data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
           byte[] buffer = Encoding.ASCII.GetBytes (data);
           int timeout = 120;
           PingReply reply = pingSender.Send (args[0], timeout, buffer,
options);
           if (reply.Status == IPStatus.Success)
           {
               Console.WriteLine ("Address: {0}", reply.Address.ToString
());
               Console.WriteLine ("RoundTrip time: {0}",
reply.RoundtripTime);
               Console.WriteLine ("Time to live: {0}", reply.Options.Ttl);
               Console.WriteLine ("Don't fragment: {0}",
reply.Options.DontFragment);
               Console.WriteLine ("Buffer size: {0}", reply.Buffer.Length);
           }
       }
   }
}
Kevin Spencer - 13 Dec 2005 21:44 GMT
Visual Studio.Net 2003 does not support .Net Framework 2.0.

Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.

> Hi,
>
[quoted text clipped - 43 lines]
>    }
> }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.