From 1abdedef5a451b439e5c3c99810fad0f1894e282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Sun, 20 Aug 2017 23:08:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3NetUri=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E7=B1=BB=E5=9E=8B=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Net/NetUri.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Net/NetUri.cpp b/Net/NetUri.cpp index 22345569..9b64ab84 100644 --- a/Net/NetUri.cpp +++ b/Net/NetUri.cpp @@ -12,11 +12,12 @@ NetUri::NetUri() NetUri::NetUri(const String& uri) : NetUri() { - if(uri.CompareTo("Tcp", 3, true) == 0) + auto t = uri.Substring(0, 3); + if(t.EqualsIgnoreCase("Tcp")) Type = NetType::Tcp; - else if(uri.CompareTo("Udp", 3, true) == 0) + else if(t.EqualsIgnoreCase("Udp")) Type = NetType::Udp; - else if(uri.CompareTo("Http", 4, true) == 0) + else if(uri.Substring(0, 4).EqualsIgnoreCase("Http")) Type = NetType::Http; int p = uri.LastIndexOf("/");