當前位置: 首頁>>代碼示例>>C#>>正文


C# RakString.Truncate方法代碼示例

本文整理匯總了C#中RakNet.RakString.Truncate方法的典型用法代碼示例。如果您正苦於以下問題:C# RakString.Truncate方法的具體用法?C# RakString.Truncate怎麽用?C# RakString.Truncate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在RakNet.RakString的用法示例。


在下文中一共展示了RakString.Truncate方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Main


//.........這裏部分代碼省略.........
            Console.WriteLine(testRakString);
            testRakString.CopyData(testRakString);
            testRakString.Serialize(testBitStream2);
            testRakString.Deserialize(testBitStream2);
            testRakString.SerializeCompressed(testBitStream2);
            testRakString.DeserializeCompressed(testBitStream2);
            workingRakStringCopy = testRakString.Assign("MayJuneJuly", 0, 3);
            workingRakStringCopy.Dispose();

            testRakString.Erase(0, 1);

            Console.WriteLine(testRakString.Find("y", 0));
            Console.WriteLine(testRakString.GetLength());
            Console.WriteLine(testRakString.IPAddressMatch("127.0.0.1"));
            Console.WriteLine(testRakString.IsEmailAddress());
            Console.WriteLine(testRakString.IsEmpty());
            Console.WriteLine(testRakString.MakeFilePath());
            testRakString.Printf();
            testRakString.RemoveCharacter('a');
            testRakString.Replace(0, 1, 'c');
            testRakString.Set("cat");
            testRakString.SetChar(0, 'r');
            testRakString.SQLEscape();
            Console.WriteLine(testRakString.StrCmp(testRakString));
            Console.WriteLine(testRakString.StrICmp(testRakString));
            workingRakStringCopy = testRakString.SubStr(0, 2);
            Console.WriteLine(workingRakStringCopy);
            workingRakStringCopy.Dispose();
            Console.WriteLine(testRakString);
            testRakString.TerminateAtFirstCharacter('y');
            testRakString.TerminateAtLastCharacter('y');
            Console.WriteLine(testRakString.ToLower());
            Console.WriteLine(testRakString.ToUpper());
            testRakString.Truncate(2);
            testRakString.URLDecode();
            testRakString.URLEncode();

            //PluginInterface2
            testUDPProxyServer.GetRakPeerInterface();

            //RakPeerInterface
            testPacket = testClient.AllocatePacket(5);
            testClient.AddToBanList("127.0.0.1", 10);
            testClient.AddToSecurityExceptionList("127.0.0.1");
            testBuffer = testPacket.data;
            testClient.AdvertiseSystem("127.0.0.1",60002,testBuffer,testBuffer.Length);
            testClient.AllowConnectionResponseIPMigration(false);
            testClient.CancelConnectionAttempt(testClient.GetSystemAddressFromIndex(0));
            testClient.ChangeSystemAddress(testClient.GetGUIDFromIndex(0),testClient.GetSystemAddressFromIndex(0));
            testClient.ClearBanList();
            uint[] testFrequencyTable = new uint[256];
            testClient.DisableSecurity();
            testClient.GetAveragePing(new AddressOrGUID(RakNet.RakNet.UNASSIGNED_SYSTEM_ADDRESS));
            SystemAddress[] remoteSystems;
            ushort numberOfSystems=4;
            testClient.GetConnectionList(out remoteSystems,ref numberOfSystems);
            testClient.GetExternalID(RakNet.RakNet.UNASSIGNED_SYSTEM_ADDRESS);
            testClient.GetGUIDFromIndex(0);
            testClient.GetGuidFromSystemAddress(RakNet.RakNet.UNASSIGNED_SYSTEM_ADDRESS);
            int inOutInt=testBuffer.Length;
            testClient.GetIncomingPassword(testBuffer,ref inOutInt);
            testClient.GetIndexFromSystemAddress(testClient.GetSystemAddressFromIndex(0));
            testClient.GetInternalID();
            testClient.GetLastPing(new AddressOrGUID(RakNet.RakNet.UNASSIGNED_SYSTEM_ADDRESS));
            testClient.GetLocalIP(0);
            testClient.GetLowestPing(new AddressOrGUID(RakNet.RakNet.UNASSIGNED_SYSTEM_ADDRESS));
開發者ID:0521guo,項目名稱:RakNet,代碼行數:67,代碼來源:TestMain.cs


注:本文中的RakNet.RakString.Truncate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。