Encog.Util.HTTP.FormUtility.Add C# (CSharp) Method

Add() public method

Add a regular text field to either a regular or multipart form.
public Add ( String name, String v ) : void
name String The name of the field.
v String The value of the field.
return void
        public void Add(String name, String v)
        {
            if (_boundary != null)
            {
                Boundary();
                WriteName(name);
                Newline();
                Newline();
                Writeln(v);
            }
            else
            {
                if (!_first)
                {
                    Write("&");
                }
                Write(Encode(name));
                Write("=");
                Write(Encode(v));
            }
            _first = false;
        }

Usage Example

コード例 #1
0
ファイル: YahooSearch.cs プロジェクト: neismit/emds
 public ICollection<Uri> Search(string searchFor)
 {
     ICollection<Uri> is2 = null;
     string str;
     int num;
     bool flag;
     MemoryStream os = new MemoryStream();
     FormUtility utility = new FormUtility(os, null);
     if ((((uint) flag) + ((uint) num)) <= uint.MaxValue)
     {
         utility.Add("appid", "YahooDemo");
         goto Label_00E2;
     }
     Label_0093:
     if (((uint) flag) <= uint.MaxValue)
     {
         os.Dispose();
         Uri uri = new Uri("http://search.yahooapis.com/WebSearchService/V1/webSearch?" + str);
         num = 0;
         flag = false;
         while (!flag)
         {
             try
             {
                 is2 = this.x7cdeaeac68d869b5(uri);
                 flag = true;
             }
             catch (IOException)
             {
                 do
                 {
                     if (num == 5)
                     {
                         throw;
                     }
                     Thread.Sleep(0x1388);
                 }
                 while ((((uint) flag) - ((uint) num)) > uint.MaxValue);
             }
             num++;
         }
         return is2;
     }
     Label_00E2:
     utility.Add("results", "100");
     utility.Add("query", searchFor);
     utility.Complete();
     str = new ASCIIEncoding().GetString(os.GetBuffer());
     goto Label_0093;
 }
All Usage Examples Of Encog.Util.HTTP.FormUtility::Add