Example #1
0
        public static ZIntDescriptor Diag_array(ZIntDescriptor a) // Заполнение -1 ближайшей не равной 0 величиной
        {
            int            ind1 = a.ind1;
            int            ind2 = a.ind2;
            ZIntDescriptor b    = new ZIntDescriptor(ind1, ind2);

            //MessageBox.Show(" ind1 -- " + ind1 + " ind2 -- " + ind2);
            for (int j = -ind1; j <= ind2; j++)
            {
                //a.SetValue(j, -2);
                //MessageBox.Show(" j= " + j + " a.GetValue(j) = " + a.GetValue(j));
                if (a.GetValue(j) < 0)
                {
                    par par1 = Left(a, j);
                    par par2 = Right(a, j);
                    int bmin = a.GetValue(par1.i);              // Индекс левого элемента
                    int bmax = a.GetValue(par2.i);              // Индекс правого элемента
                    //MessageBox.Show(" j= " + j + " min_left= " + par1.s + " min_right= " + par2.s + " il= " + bmin + " ir= " + bmax);
                    if (par1.s < par2.s)
                    {
                        b.SetValue(j, bmin);
                    }
                    else
                    {
                        b.SetValue(j, bmax);
                    }
                }
                else
                {
                    b.SetValue(j, a.GetValue(j));
                }
            }
            return(b);
        }
Example #2
0
        /// <summary>
        /// Генерация параграфа с разделителем \r\n
        /// </summary>
        /// <param name="text">Текст с разделителями \r\n</param>
        /// <returns></returns>
        private par GenerateParagraphNewCollection(string text)
        {
            string[] stringSeparators = new string[] { "\r\n" };
            var      strParagraph     = text.Split(stringSeparators, StringSplitOptions.None);
            var      paragraph        = new par()
            {
                Items = new List <object>()
            };

            foreach (var paragraphText in strParagraph)
            {
                paragraph.Items.Add(new run()
                {
                    Items = new List <object>()
                    {
                        new font()
                        {
                            size = "14pt"
                        }
                    },
                    Text = new List <string>(new[] { paragraphText })
                });
                paragraph.Items.Add(new @break());
            }
            return(paragraph);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        par p = new par();

        p.partnerid   = "18871";
        p.servicetype = "LLWebApi_CL_GetWTSData";
        //传参待定
        p.bizdata   = "{\"id\":\"204852\"}";
        p.timestamp = string.Format("{0:yyyyMMddHHmmss}", DateTime.Now);
        p.nonce     = System.Guid.NewGuid().ToString();

        p.sign = GetSign(p.partnerid, p.servicetype, p.bizdata, p.timestamp, p.nonce);
        //正式
        string url = @"http://webt.lilang.com/LLService/ApiRoute.ashx?action=llwebapi";
        //测试
        //string url = @"http://192.168.35.231/LLWebApi/ApiRoute.ASHX?action=llwebapi";
        string postJson = string.Format("partnerid={0}&servicetype={1}&bizdata={2}&timestamp={3}&nonce={4}&sign={5}", p.partnerid, p.servicetype, p.bizdata, p.timestamp, p.nonce, p.sign);

        string r = PostFunction(url, postJson);

        Response.Write(r);
    }