Programming with Microsoft Visual C++.NET 6ed [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Programming with Microsoft Visual C++.NET 6ed [Electronic resources] - نسخه متنی

George Shepherd, David Kruglinski

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید








Building an Intranet


Building a Windows-based intranet is easy and cheap. Windows 95/98/Me and Windows NT/2000/XP all contain the necessary networking capabilities. If you don't want to spend the money, you can build a free intranet within a single computer. All the code in this chapter will run on this one-computer configuration.


NTFS vs. FAT File Systems


With Windows 95/98/Me, you're restricted to one file system, File Allocation Table (FAT)—or Virtual File Allocation Table (VFAT) for long filenames. With Windows NT/2000/XP, you get the NT file system (NTFS). Your intranet will be much more secure using NTFS because NTFS allows you to set user permissions for individual directories and files. Users log on to a Windows server (or to an attached workstation) and supply a username and password.

Intranet and Internet clients participate in this operating system security scheme because the server can log them on as if they were local users. Thus, you can restrict access to any server directory or file to specific users who must supply passwords. If those user workstations are Windows network clients (as would be the case with a LAN-based intranet), the username and password are passed through from the user's logon.



Network Hardware


You obviously need more than one computer to make a network. Your main development computer will probably be a Pentium-based computer, but chances are you'll have at least one old computer hanging around. It makes sense to connect it to your main computer for intranet testing and file backups.

You'll need a network board for each computer, but 10-megabit-per-second Ethernet boards are now extremely inexpensive. Choose a brand that comes with its own drivers for Windows 95/98/Me and Windows NT/2000/XP or is already supported by those operating systems. To see a list of supported boards in Windows NT and Windows 95/98/Me, click on the Network icon in Control Panel and then click the Add button to add an adapter. To see the list of supported boards in Windows 2000 and Windows XP, click on the Network And Dial-up Connections icon in Control Panel, right-click on any local area connection, click Properties, and then select Install to add an adapter.

Most network boards have connectors for both thin coaxial (coax) and 10BaseT twisted pair cable. With 10BaseT, you must buy a hub. Thin coax requires only coaxial cable (which is available in precut lengths with connectors) plus terminator plugs. With coax, you daisy-chain your computers together and put terminators on each end of the chain.

Follow the instructions that come with the network board. In most cases, you'll have to run an MS-DOS program that writes to the electrically erasable programmable read-only memory (EEPROM) on the board. Write down the values you select—you'll need them later.



Configuring Windows for Networking


Control Panel's Network applet lets you configure network settings. During configuration, you must select TCP/IP as one of your protocols if you want to run an intranet. You must also install the Windows driver for your network board, ensuring that the IRQ and I/O address values match what you put into the board's EEPROM. You must also assign an IP address to each of your network boards. If you're not connected directly to the Internet, you can choose any unique address you want.

That's actually enough configuring for an intranet, but you'll probably want to use your network for sharing files and printers, too. For Windows NT, install Client And Server Services and bind them to TCP/IP. For Windows 95/98/Me, install Client For Microsoft Networks and File And Printer Sharing For Microsoft Networks. For Windows 2000/XP, the File And Printer Sharing For Microsoft Networks component is installed and enabled by default. If you have an existing network with another protocol installed (Novell IPX/SPX or Microsoft NetBEUI, for example), you can continue to use that protocol on the network along with TCP/IP. In that case, Windows file and print sharing will use the existing protocol and your intranet will use TCP/IP. If you want one computer to share another computer's resources, you must enable sharing from Windows Explorer (for disk directories) or from the Printers folder (for printers).



Intranet Host Names and the HOSTS File


Both Internet and intranet users expect their browsers to use host names, not IP addresses. There are various methods of resolving names to addresses, including using your own DNS server, which is an installable component of Windows NT/2000 Server. The easiest way to map Internet host names to IP addresses, however, is to use the HOSTS file. In Windows NT/2000/XP, this is a text file in the \Winnt\System32\DRIVERS\ETC directory. In Windows 95/98/Me, it's in the \WINDOWS directory, in a prototype HOSTS.SAM file. Just copy that file to HOSTS and make the entries with Notepad. Be sure to copy the edited HOSTS file to all computers in the network.



Testing Your Intranet: The Ping Program


You can use the Windows Ping program to test your intranet. From the command line, type ping, followed by the IP address (in dotted-decimal format) or the host name of another computer on the network. If you get a positive response, you'll know that TCP/IP is configured correctly. If you get no response or an error message, proceed no further. Go back and troubleshoot your network connections and configuration.



An Intranet for One Computer: The TCP/IP Loopback Address


The first line in the HOSTS file should be the following:

127.0.0.1       localhost

This is the standard loopback IP address. If you start a server program to listen on this address, client programs running on the same machine can connect to localhost to get a TCP/IP connection to the server program. This works whether or not you have network boards installed.



/ 319