惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
宝玉的分享
宝玉的分享
月光博客
月光博客
B
Blog
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
博客园_首页
GbyAI
GbyAI
人人都是产品经理
人人都是产品经理
A
About on SuperTechFans
Y
Y Combinator Blog
L
LangChain Blog
有赞技术团队
有赞技术团队
D
Docker
爱范儿
爱范儿
博客园 - 司徒正美
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net

博客园 - luckyzmw

ASP.net里大文件上传的问题讨论 E680最强综合技巧集合 E680I常用工具和使用说明 Code Snippet Libraries压缩下载包 企业库中的一个小发现 企业库中的objectBuild类分析 企业库core中configuration部分类的分析 如何创建一个自定义帐户来运行 ASP.NET 新手学习XSL的好东西 UML相关的工具 广告管理系统的UML分析与设计 几家最好的IT公司面试全揭秘 ASP.NET常用代码 多线程的简单示例 Microsoft Windows Workflow Foundation 入门:开发人员演练 为何使用表格排版是不明智的 Fitch and Mather 7.0 概述 MAVERICK.NET好用吗 ASP.NET下MVC设计模式的实现
NameValueCollection的用法
luckyzmw · 2005-12-11 · via 博客园 - luckyzmw

此集合基于 NameObjectCollectionBase 类。但与 NameObjectCollectionBase 不同,该类在一个键下存储多个字符串值。

该类可用于标头、查询字符串和窗体数据。

using System;

namespace ConsoleApplication5
{
    
/// <summary>
    
/// Class1 的摘要说明。
    
/// </summary>

    class Class1
    
{
        
/// <summary>
        
/// 应用程序的主入口点。
        
/// </summary>

        [STAThread]
        
static void Main(string[] args)
        
{
            System.Collections.Specialized.NameValueCollection c 
= new System.Collections.Specialized.NameValueCollection();
            c.Add(
"a","a");
            c.Add(
"1","3");
            c.Add(
"z","z");
            c.Add(
"1","1");
            c.Add(
"d","d");
            
            
for (int i=0; i<c.Count; i++)
            
{
                
foreach (string str in c.GetValues(i))
                
{
                    Console.WriteLine(str);
                }

            }

            Console.ReadLine();
        }

    }

}