当前位置: 首页>>代码示例>>C#>>正文


C# System.Collections.Specialized.NameValueCollection.Remove方法代码示例

本文整理汇总了C#中System.Collections.Specialized.NameValueCollection.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.Specialized.NameValueCollection.Remove方法的具体用法?C# System.Collections.Specialized.NameValueCollection.Remove怎么用?C# System.Collections.Specialized.NameValueCollection.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Collections.Specialized.NameValueCollection的用法示例。


在下文中一共展示了System.Collections.Specialized.NameValueCollection.Remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RenderMetafilesForReport

        public static List<System.Drawing.Imaging.Metafile> RenderMetafilesForReport(
            SSRSCommon.ReportService2005.ReportingService2005  rep_svc,
            SSRSCommon.ReportExecutionService.ReportExecutionService rep_exec_svc, string reportpath, EMFRenderPrefs userprintprefs, int FirstNPages)
        {

            var exec_header = new SSRSCommon.ReportExecutionService.ExecutionHeader();

            rep_exec_svc.ExecutionHeaderValue = exec_header;
            string historyid = null;

            Console.WriteLine("Loading Report");
            var exec_info = rep_exec_svc.LoadReport(reportpath, historyid);

            //rs2.SetExecutionParameters(parameters, "en-us");

            var session_id = rep_exec_svc.ExecutionHeaderValue.ExecutionID;
            Console.WriteLine("Session ID: {0}", rep_exec_svc.ExecutionHeaderValue.ExecutionID);

            var streams = new List<System.IO.Stream>();
            var metafiles = new List<System.Drawing.Imaging.Metafile>();
            string render_format = "IMAGE";

            int cur_page_count = 0;

            try
            {
                // Create the Viewer and Bind it to the Server Report
                Console.WriteLine("Creating the ReportViewer Control");
                var viewer = new Microsoft.Reporting.WinForms.ReportViewer();
                viewer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;
                var server_report = viewer.ServerReport;
                Console.WriteLine("Server Report DisplayName: {0}", server_report.DisplayName);
                Console.WriteLine("Server Report ReportPath: {0}", server_report.ReportPath);
                Console.WriteLine("Server Report ReportServerUrl: {0}", server_report.ReportServerUrl);
                Console.WriteLine("Server Report Timeout: {0}", server_report.Timeout);


                viewer.ServerReport.ReportServerUrl = new Uri(get_correct_url(rep_svc.Url));
                viewer.ServerReport.ReportPath = reportpath;
                Console.WriteLine("Report Viewer ProcessingMode: {0}", viewer.ProcessingMode);
                Console.WriteLine("Report Viewer ReportServerUrl: {0}", viewer.ServerReport.ReportServerUrl);
                Console.WriteLine("Report Viewer ReportPath: {0}", viewer.ServerReport.ReportPath);

                // Setup URL Parameters
                Console.WriteLine("Creating the URL Parameters");
                var url_params = new System.Collections.Specialized.NameValueCollection();
                url_params.Add("rs:PersistStreams", "True");

                // Create DeviceInfo XML
                var devinfo = new SSRSCommon.DeviceInfo();
                devinfo.OutputFormat = "EMF"; // force it to emf
                devinfo.Toolbar = false;
                devinfo.PrintDpiX = emf_render_dpi.Width;
                devinfo.PrintDpiY = emf_render_dpi.Height;
                // Finished with DeviceInfo XML

                string device_info = devinfo.ToString();
                Console.WriteLine("DeviceInfo: {0}", device_info);

                // render first stream
                Console.WriteLine("Starting Rendering First Stream");

                string rendered_mimetype;
                string rendered_extension;

                var rendered_stream = server_report.Render(
                    render_format,
                    device_info,
                    url_params,
                    out rendered_mimetype,
                    out rendered_extension);

                Console.WriteLine("Finished Rendering First Stream");

                streams.Add(rendered_stream);

                cur_page_count++;
                // Handle the addtional streams

                Console.WriteLine("Retrieving Additional Streams");
                url_params.Remove("rs:PersistStreams");
                url_params.Add("rs:GetNextStream", "True");
                do
                {
                    // Check to see if user only wanted the first N pages of the report

                    if (FirstNPages > 0)
                    {
                        if (cur_page_count >= FirstNPages)
                        {
                            break;
                        }
                    }

                    // ------------
                    Console.WriteLine("Starting Rendering Additional Stream");
                    rendered_stream = server_report.Render(
                        render_format,
                        device_info,
                        url_params,
//.........这里部分代码省略.........
开发者ID:saveenr,项目名称:saveenr,代码行数:101,代码来源:RSUtil.cs

示例2: AddRouteValues

 public static ActionResult AddRouteValues(this ActionResult result, System.Collections.Specialized.NameValueCollection nameValueCollection)
 {
     // Copy all the values from the NameValueCollection into the route dictionary
     if (nameValueCollection.AllKeys.Any(m => m == null))  //if it has a null, the CopyTo extension will crash!
     {
         var filtered = new System.Collections.Specialized.NameValueCollection(nameValueCollection);
         filtered.Remove(null);
         filtered.CopyTo(result.GetRouteValueDictionary());
     }
     else
         nameValueCollection.CopyTo(result.GetRouteValueDictionary());
     return result;
 }
开发者ID:shahr00z,项目名称:TavanTarkhis,代码行数:13,代码来源:T4MVC.cs

示例3: removeQueryString

        public JsonResult removeQueryString(string filtro, string valor, string query){

            var httpValues = new System.Collections.Specialized.NameValueCollection();
            httpValues.Add(HttpUtility.ParseQueryString(query));
            httpValues.Remove(filtro);


            var routeValue = new RouteValueDictionary();

            foreach(var key in httpValues.AllKeys) {
                routeValue.Add(key, httpValues[key]);
            }

            return Json(new { RedirectUrl = Url.Action("Index", "Produto", routeValue) }, JsonRequestBehavior.AllowGet);

        }
开发者ID:joaopaulonobrega,项目名称:e-commerce,代码行数:16,代码来源:ProdutoController.cs


注:本文中的System.Collections.Specialized.NameValueCollection.Remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。