入门

来源:互联网 发布:题库系统源码 编辑:程序博客网 时间:2024/05/01 06:16


对这页进行简单翻译http://www.networkcomms.net/getting-started/

We hope the following tutorial helps get you up and running as quickly as possible. If you feel something is missing or confusing please leave a comment below. If this tutorial is not exactly what you were after please see our  tutorials section for more information.

如果还有不懂的请尽情评论提问。如果需要更多的教程,请参看其它。


What you need to get up and running:[运行前提]
1.Visual Studio 2010 Express or better (Including .Net4).
2.The latest release of NetworkComms.Net. Please see our Download section.

Then what?

Once you have everything you need you probably want to start working your way through the included examples.

Part 1 – Compile the examples …[将压缩包中的例子进行编译]
1.Extract the downloaded zip file to a suitable location.
2.Browser to the location chosen in step 1 and open the examples solution file (Examples\NetworkComms.Net Examples.sln). This should open in Visual Studio. Note: You may see notifications related to Unsupported project types for platforms such as Windows Phone, iOS etc, due to missing necessary SDKs, you can safely ignore these notifications.


3.Compile all projects by hitting F6 or right clickingon the solution within Visual Studio’s Solution Explorer Window and select ‘Build Solution’. This creates the necessary project executables. Note: If you see any build errors due to namespaces ‘ProtoBuf’ or ‘NLog’ please ensure your NuGet Package Manager is correctly configured. These are external packages/dependencies that should be downloaded when you first build the solution.

Part 2 – Run the basic example  …
1.You can run all of the examples on the same computer or across different ones. For the sake of this demonstration[演示] we will run them both locally (Just make the appropriate IP change when requested[更改一下IP] if running on different computers).
2.Browse to the location where you extracted the solution in Part 1. Now browse to  “ExamplesConsole\bin\Debug\”  . This directory should contain the executables compiled in Part 1. If not make sure Visual Studio is configured to build Debug.
3.Execute “ExamplesConsole.exe”. This should open in a new console window. Press ‘n’ to leave logging disabled.
4.Run the basic example by selecting option ‘1’.
5.The output of the console should be reset and now start with a line saying  “Listening for messages on:”  . What follows is a list of all IPs detected on the local machine and the port number now opened by the example. You may be presented with various firewall messages asking if you trust the application to open the desired port, ensure you DO give the necessary permissions.
6.You now need to open a second instance of “ExamplesConsole.exe”. This can be on the same or different computer. Make sure you select the basic example again using option ‘1’.
7.The output of the second instance should again start with  “Listening for messages on:”  .
8.You can now send messages from one instance to the other using NetworkComms.Net. In the instance of your choice type a message as directed and press return.
9.Enter the IP address and port of the destination instance. This should be in the form IPAddress:Port, e.g. 192.168.1.56:10000.
10.Press enter and hopefully the message appears in the destination instance.
11.Checkout the source code to see how short the example actually is. You can view the example source in Visual Studio by browsing to the ‘BasicSend.cs’ code file within the ExamplesConsole project. The code is also included below.
12.Bear in mind it is possible to break the basic example. No error handling was included to help keep things as short as possible.

Part 3 – Run the other examples and discover the more advanced features available …
1.Execute “ExamplesConsole.exe” as in part 2 and following directions provided when the other examples are selected. If you have any problems see here.

0 0