7.2. 从Url中提取域Domain:extractDomain


    //extrat the domain from input url
    //example: from https://skydrive.live.com/, extracted domain is ".live.com"
    public string extractDomain(string url)
    {
        string host = "";
        string domain = "";
        host = extractHost(url);
        if (host.Contains("."))
        {
            domain = host.Substring(host.IndexOf('.'));
        }
        return domain;
    }

    

例 7.2. extractDomain 的使用范例


    private string gCurDomain;
    //update latest cookies
    gCurDomain = commLib.extractDomain(getItemsUrl);