コード例 #1
0
        public static string UserLogin(string UserName, string Password)
        {
            string         Result         = "";
            string         webAddr        = "http://protecttw.cloudapp.net/Service1.svc/Login/" + UserName + "/" + Password + "/" + Guid.NewGuid();
            HttpWebRequest httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(webAddr);

            httpWebRequest.ContentType = "application/json";
            httpWebRequest.Method      = "GET";
            HttpWebResponse            response  = (HttpWebResponse)httpWebRequest.GetResponse();
            Stream                     resStream = response.GetResponseStream();
            DataContractJsonSerializer obj       = new DataContractJsonSerializer(typeof(string));
            string                     GetData   = obj.ReadObject(resStream) as string;

            int InsertValue;

            if (int.TryParse(GetData, out InsertValue) == true)
            {
                Result = InsertValue.ToString();
            }
            else
            {
                Result = GetData;
            }
            return(Result);
        }
コード例 #2
0
        public static bool Consume(Parser parser)
        {
            if (!parser.Terminal("INSERT"))
            {
                return(false);
            }
            if (!parser.Terminal("INTO"))
            {
                return(false);
            }
            if (!TableName.Consume(parser))
            {
                return(false);
            }
            if (parser.Peek("("))
            {
                parser.Terminal("(");
                if (!ColumnIdentifier.Consume(parser))
                {
                    return(false);
                }
                while (parser.Peek(","))
                {
                    parser.Terminal(",");
                    if (!ColumnIdentifier.Consume(parser))
                    {
                        return(false);
                    }
                }
                parser.Terminal(")");
            }

            if (!parser.Terminal("VALUES"))
            {
                return(false);
            }
            if (!parser.Terminal("("))
            {
                return(false);
            }
            if (!InsertValue.Consume(parser))
            {
                return(false);
            }
            while (parser.Peek(","))
            {
                parser.Terminal(",");
                if (!InsertValue.Consume(parser))
                {
                    return(false);
                }
            }
            return(parser.Terminal(")"));
        }
コード例 #3
0
 /// <summary>
 /// Gets or sets the element with the specified key.
 /// </summary>
 public TValue this[TKey key]
 {
     get
     {
         TValue result;
         if (!TryGetValue(key, out result))
         {
             throw new IndexOutOfRangeException();
         }
         return(result);
     }
     set
     {
         InsertValue ii = new InsertValue(value, true);
         AddEntry(key, ref ii);
     }
 }
コード例 #4
0
        public void AddOrUpdate(TKey key, TValue value)
        {
            InsertValue ii = new InsertValue(value, true);

            AddEntry(key, ref ii);
        }
コード例 #5
0
        /// <summary>
        /// Adds an element with the provided key and value to the <see cref="T:System.Collections.Generic.IDictionary`2"/>.
        /// </summary>
        public void Add(TKey key, TValue value)
        {
            InsertValue ii = new InsertValue(value, false);

            AddEntry(key, ref ii);
        }
コード例 #6
0
        void ICollection <KeyValuePair <TKey, TValue> > .Add(KeyValuePair <TKey, TValue> item)
        {
            InsertValue ii = new InsertValue(item.Value, false);

            AddEntry(item.Key, ref ii);
        }