Esempio n. 1
0
        public void DoPost(HttpWebRequest req, HttpWebResponse res)
        {
            StreamWriter twOut = null;

            int[] bytesOut = new int[1]; bytesOut[0] = 0;

            string unm = "", sid = "", uty = "", men = "", den = "", dnm = "", bnm = "";

            try
            {
                directoryUtils.SetContentHeaders(res);

                twOut = new StreamWriter(res.GetResponseStream());

                // Http handling TODO
                //unm = req.getParameter("unm");
                //sid = req.getParameter("sid");
                //uty = req.getParameter("uty");
                //men = req.getParameter("men");
                //den = req.getParameter("den");
                //dnm = req.getParameter("dnm");
                //bnm = req.getParameter("bnm");

                DoIt(twOut, req, unm, sid, uty, men, den, dnm, bnm, bytesOut);
            }
            catch (Exception e)
            {
                string url = req.RequestUri.ToString();

                int x = 0;
                if (url[x] == 'h' || url[x] == 'H')
                {
                    x += 7;
                }
                string urlBit = "";
                while (url[x] != '\0' && url[x] != ',' && url[x] != '/')
                {
                    urlBit += url[x++];
                }

                messagePage.errorPage(twOut, req, e, "Communications Error", unm, sid, dnm, bnm, urlBit, men, den, uty, "AboutZara", bytesOut);
                serverUtils.ETotalBytes(req, unm, dnm, 188, bytesOut[0], 0, 0, "ERR:");
                if (twOut != null)
                {
                    twOut.Flush();
                }
            }
        }