當前位置: 首頁>>代碼示例>>C#>>正文


C# ListDictionary.Add方法代碼示例

本文整理匯總了C#中System.Collections.Specialized.ListDictionary.Add方法的典型用法代碼示例。如果您正苦於以下問題:C# ListDictionary.Add方法的具體用法?C# ListDictionary.Add怎麽用?C# ListDictionary.Add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Collections.Specialized.ListDictionary的用法示例。


在下文中一共展示了ListDictionary.Add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SendWelcomeEmail

        public static void SendWelcomeEmail(string mailTo ,Guid orgId, string tournamentId, string orgLogo, string tournamentName, DateTime startDate)
        {
            ListDictionary replacements = new ListDictionary();
            replacements.Add("<% OrgId %>", orgId);
            replacements.Add("<% TournamentName %>", tournamentName);
            replacements.Add("<% StartDate %>", startDate);
            replacements.Add("<% TournamentId %>", tournamentId);

            string templatePath = Path.Combine(ConfigurationManager.AppSettings["EmailTemplatePath"].ToString(), "WelcomeEmail.htm");
            string matchUpReadyTemplate = File.ReadAllText(templatePath);
            SmtpClient client = new SmtpClient(); //host and port picked from web.config
            client.EnableSsl = true;

            foreach (DictionaryEntry item in replacements)
            {
                matchUpReadyTemplate = matchUpReadyTemplate.Replace(item.Key.ToString(), item.Value.ToString());
            }
            MailMessage message = new MailMessage();
            message.Subject = "Welcome Email";
            message.From = new MailAddress("[email protected]");
            message.To.Add(mailTo);
            message.IsBodyHtml = true;
            message.Body = matchUpReadyTemplate;

            try
            {
                client.Send(message);
            }
            catch (Exception)
            {

            }
        }
開發者ID:shaileshgajula,項目名稱:c8a5b00a-1d86-40ff-a172-35d865eeec09,代碼行數:33,代碼來源:PlayersRegistration.cs

示例2: AddNew

        public bool AddNew(string _title, string _description,string _filePath,bool _showLive,
            int? _govID,int? _civilID,int? _hoID,Guid _userID,string _cType,byte[] _file)
        {
            try
            {
                SqlDataReader searchResult = null;
                ListDictionary parm = new ListDictionary();

                parm.Add("@title", _title);
                parm.Add("@description", _description);
                parm.Add("@filePath", _filePath);
                parm.Add("@showLive", _showLive);

                if (_govID != null)
                    parm.Add("@govid", _govID);
                if (_civilID != null)
                    parm.Add("@civilid", _civilID);
                if (_hoID != null)
                    parm.Add("@healthofficeid", _hoID);
                if (_file != null)
                {
                    parm.Add("@contentType", _cType);
                    parm.Add("@fileData", _file);
                }

                parm.Add("@createdbyuserid", _userID);

                searchResult = LoadFromSqlReader("GUI_AddNews", parm) as SqlDataReader;
                return true;
            }
            catch
            {
                return false;
            }
        }
開發者ID:menasbeshay,項目名稱:ivalley-svn,代碼行數:35,代碼來源:News.cs

示例3: SendManagementEmails

        private void SendManagementEmails()
        {
            //Sending out emails

            MailDefinition md = new MailDefinition();
            md.From = ConfigurationManager.AppSettings["MailFrom"];
            md.IsBodyHtml = true;
            md.Subject = ConfigurationManager.AppSettings["emailSubjectContact"];

            ListDictionary replacements = new ListDictionary();

            replacements.Add("<%client_name%>", (string)(Session["client_name"]));
            replacements.Add("<%client_phone%>", (string)(Session["client_phone"]));
            replacements.Add("<%client_email%>", (string)(Session["client_email"]));
            replacements.Add("<%client_message%>", (string)(Session["client_message"]));

            string body = String.Empty;

            using (StreamReader sr = new StreamReader(Server.MapPath(ConfigurationManager.AppSettings["emailPath"] + "contact.txt")))
            {
                body = sr.ReadToEnd();
            }

            MailMessage msg = md.CreateMailMessage(ConfigurationManager.AppSettings["mecene_Email"], replacements, body, new System.Web.UI.Control());

            SmtpClient sc = new SmtpClient();
            sc.Send(msg);
        }
開發者ID:meceneGithub,項目名稱:WSTFORG,代碼行數:28,代碼來源:contact.aspx.cs

示例4: Report_PaymentsWithinPeriod

 public virtual bool Report_PaymentsWithinPeriod(DateTime? From, DateTime? To)
 {
     ListDictionary parameters = new ListDictionary();
     parameters.Add(new SqlParameter("@From", SqlDbType.DateTime, 0), From);
     parameters.Add(new SqlParameter("@To", SqlDbType.DateTime, 0), To);
     return LoadFromSql("Report_PaymentsWithinPeriod", parameters);
 }
開發者ID:menasbeshay,項目名稱:ivalley-svn,代碼行數:7,代碼來源:Payments.cs

示例5: deSerialize

        public static void deSerialize()
        {
            string sPath = HttpContext.Current.Server.MapPath("~/config/config.txt");
            if (!File.Exists(sPath))
            {
                m_lListDictionary = new ListDictionary();
                return;
            }

            m_lListDictionary = new ListDictionary();
            TextReader oTr = File.OpenText(sPath);

            char cN1 = '\n';

            string sTemp = oTr.ReadToEnd();
            string[] asTemp = sTemp.Split(cN1);

            foreach (string sLine in asTemp)
            {
                if (sLine.Length == 0)
                    continue;

                string[] asTemp2 = sLine.Split(',');

                if (asTemp[0].ToString() == "DatabasePassword")
                {
                    CCrypt oCrypt = new CCrypt();
                    m_lListDictionary.Add(asTemp2[0], oCrypt.DESDecrypt(asTemp2[1]));
                    continue;
                }
                m_lListDictionary.Add(asTemp2[0], asTemp2[1]);
            }

            oTr.Close();
        }
開發者ID:pcgalen,項目名稱:Bind,代碼行數:35,代碼來源:Utility.cs

示例6: SearchTickets

 public virtual bool SearchTickets(string txt, int statusID)
 {
     ListDictionary parameters = new ListDictionary();
     parameters.Add(new SqlParameter("@StatusID", SqlDbType.Int, 0), statusID);
     parameters.Add(new SqlParameter("@SearchTxt", SqlDbType.NVarChar, 300), txt);
     return LoadFromSql("SearchAllTickets", parameters);
 }
開發者ID:menasbeshay,項目名稱:ivalley-svn,代碼行數:7,代碼來源:Tickets.cs

示例7: FilterICDcodes

        public DataTable FilterICDcodes(string initText, int gender)
        {
            try
            {
                //string connection = ConfigurationSettings.AppSettings["dbConnection"];
                //SqlConnection con = new SqlConnection(connection);

                //string selectString = "select * from ICDCODE9000" + initText[0].ToString() + " where DescrENG like '" + initText + "%'";
                //SqlCommand cmd = new SqlCommand(selectString, con);
                //cmd.CommandType = CommandType.Text;
                //SqlDataAdapter adb = new SqlDataAdapter();
                //adb.SelectCommand = cmd;
                //DataTable tbl = new DataTable();
                //adb.Fill(tbl);
                //return tbl;
                SqlDataReader searchResult = null;
                ListDictionary parm = new ListDictionary();
                parm.Add("@initText", initText);
                parm.Add("@gender", gender);
                searchResult = LoadFromSqlReader("Mho_Gui_GetICDSubcode", parm) as SqlDataReader;
                DataTable ResultTable = new DataTable();
                newAdapter da = new newAdapter();
                if (searchResult != null && searchResult.HasRows)
                {
                    da.FillFromReader(ResultTable, searchResult);
                }
                return ResultTable;
            }
            catch
            {
                return new DataTable();
            }
        }
開發者ID:menasbeshay,項目名稱:ivalley-svn,代碼行數:33,代碼來源:ICD10_MainDeathReason.cs

示例8: SearchByCityIDAndCountryID

 public virtual void SearchByCityIDAndCountryID(int cityID, int countryID)
 {
     ListDictionary parameters = new ListDictionary();
     parameters.Add(new SqlParameter("@CityID", SqlDbType.Int), cityID);
     parameters.Add(new SqlParameter("@CountryID", SqlDbType.Int), countryID);
     base.LoadFromSql("[" + this.SchemaStoredProcedure + "usp_BlogPage_SearchByCityIDAndCountryID]", parameters);
 }
開發者ID:ivladyka,項目名稱:OurTravels,代碼行數:7,代碼來源:BlogPage.cs

示例9: lbSendToFriend_Click

        protected void lbSendToFriend_Click(object sender, EventArgs e)
        {
            string url = Request.Url.AbsoluteUri;
            SmtpClient client = new SmtpClient(); //host and port picked from web.config
            client.EnableSsl = true;
            MailDefinition message = new MailDefinition();

            message.BodyFileName = @"~\EmailTemplate\MiriMargolinShareWithAFriend.htm";
            message.IsBodyHtml = true;
            message.From = "[email protected]";
            message.Subject = "MiriMargolin - Share with a friend";

            ListDictionary replacements = new ListDictionary();
            replacements.Add("<% YourName %>", this.txtYourName.Text);
            replacements.Add("<% Message %>", this.txtMessage.Text);
            //MailMessage msgHtml = message.CreateMailMessage(this.txtFriendsEmail.Text, replacements, new LiteralControl());
            //msgHtml.Bcc.Add(new MailAddress(RECIPIENTS));
            try
            {
                //client.Send(msgHtml);
            }
            catch (Exception)
            {
                //this.lblMsg.Text = "There was a problem to send an email.";
            }
        }
開發者ID:shaileshgajula,項目名稱:c8a5b00a-1d86-40ff-a172-35d865eeec09,代碼行數:26,代碼來源:MiriMargolin.Master.cs

示例10: CreateTcpChannel

		/// <summary>
		///  Create a TcpChannel with a given name, on a given port.
		/// </summary>
		/// <param name="port"></param>
		/// <param name="name"></param>
		/// <returns></returns>
		private static TcpChannel CreateTcpChannel( string name, int port, int limit )
		{
			ListDictionary props = new ListDictionary();
			props.Add( "port", port );
			props.Add( "name", name );
			props.Add( "bindTo", "127.0.0.1" );

			BinaryServerFormatterSinkProvider serverProvider =
				new BinaryServerFormatterSinkProvider();

            // NOTE: TypeFilterLevel and "clientConnectionLimit" property don't exist in .NET 1.0.
			Type typeFilterLevelType = typeof(object).Assembly.GetType("System.Runtime.Serialization.Formatters.TypeFilterLevel");
			if (typeFilterLevelType != null)
			{
				PropertyInfo typeFilterLevelProperty = serverProvider.GetType().GetProperty("TypeFilterLevel");
				object typeFilterLevel = Enum.Parse(typeFilterLevelType, "Full");
				typeFilterLevelProperty.SetValue(serverProvider, typeFilterLevel, null);

//                props.Add("clientConnectionLimit", limit);
            }

			BinaryClientFormatterSinkProvider clientProvider =
				new BinaryClientFormatterSinkProvider();

			return new TcpChannel( props, clientProvider, serverProvider );
		}
開發者ID:Vernathic,項目名稱:ic-AutoTest.NET4CTDD,代碼行數:32,代碼來源:ServerUtilities.cs

示例11: ChangeUsername

        public bool ChangeUsername(string oldUsername, string newUsername, string applicationName, out string errorMsg)
        {
            errorMsg = string.Empty;
            ListDictionary parameters = new ListDictionary();
            parameters.Add(new SqlParameter("@ApplicationName", SqlDbType.NVarChar), applicationName);
            parameters.Add(new SqlParameter("@OldUserName", SqlDbType.NVarChar), oldUsername);
            parameters.Add(new SqlParameter("@NewUserName", SqlDbType.NVarChar), newUsername);
            SqlParameter retValParam = new SqlParameter("@ReturnValue", SqlDbType.Int);
            retValParam.Direction = ParameterDirection.ReturnValue;
            parameters.Add(retValParam, null);

            base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_MembershipChangeUserName]", parameters);

            int returnValue = -1;
            if (retValParam.Value != null)
            {
                returnValue = Convert.ToInt32(retValParam.Value);
                if (returnValue == 1)
                {
                    errorMsg = "إسم المستخدم المطلوب تغييره غير موجود";
                }
                else if (returnValue == 2)
                {
                    errorMsg = "الإسم الجديد مستخدم من قبل";
                }
            }
            else
            {
                errorMsg = "Unknow error";
            }

            return (returnValue == 0 ? true : false);
        }
開發者ID:menasbeshay,項目名稱:ivalley-svn,代碼行數:33,代碼來源:Membership.cs

示例12: GetUserByUserNameAndPassword

 public virtual bool GetUserByUserNameAndPassword(string UserName, string Password)
 {
     ListDictionary parameters = new ListDictionary();
     parameters.Add(new SqlParameter("@UserName", SqlDbType.NVarChar, 200), UserName);
     parameters.Add(new SqlParameter("@Password", SqlDbType.NVarChar, 200), Password);
     return LoadFromSql("GetUserByUserNameAndPassword", parameters);
 }
開發者ID:menasbeshay,項目名稱:ivalley-svn,代碼行數:7,代碼來源:ComboUser.cs

示例13: BasicTests

		private void BasicTests (ListDictionary ld)
		{
			Assert.AreEqual (0, ld.Count, "Count");
			Assert.IsFalse (ld.IsFixedSize, "IsFixedSize");
			Assert.IsFalse (ld.IsReadOnly, "IsReadOnly");
			Assert.IsFalse (ld.IsSynchronized, "IsSynchronized");
			Assert.AreEqual (0, ld.Keys.Count, "Keys");
			Assert.AreEqual (0, ld.Values.Count, "Values");
			Assert.IsNotNull (ld.SyncRoot, "SyncRoot");
			Assert.IsNotNull (ld.GetEnumerator (), "GetEnumerator");
			Assert.IsNotNull ((ld as IEnumerable).GetEnumerator (), "IEnumerable.GetEnumerator");

			ld.Add ("a", "1");
			Assert.AreEqual (1, ld.Count, "Count-1");
			Assert.IsTrue (ld.Contains ("a"), "Contains(a)");
			Assert.IsFalse (ld.Contains ("1"), "Contains(1)");

			ld.Add ("b", null);
			Assert.AreEqual (2, ld.Count, "Count-2");
			Assert.IsNull (ld["b"], "this[b]");

			DictionaryEntry[] entries = new DictionaryEntry[2];
			ld.CopyTo (entries, 0);

			ld["b"] = "2";
			Assert.AreEqual ("2", ld["b"], "this[b]2");

			ld.Remove ("b");
			Assert.AreEqual (1, ld.Count, "Count-3");
			ld.Clear ();
			Assert.AreEqual (0, ld.Count, "Count-4");
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:32,代碼來源:ListDictionaryTest.cs

示例14: lbSend_Click

        protected void lbSend_Click(object sender, EventArgs e)
        {
            SmtpClient client = new SmtpClient(); //host and port picked from web.config
            client.EnableSsl = true;
            MailDefinition message = new MailDefinition();

            message.BodyFileName = @"~\EmailTemplate\MiriMargolinContact.htm";
            message.IsBodyHtml = true;
            message.From = "[email protected]";
            message.Subject = "MiriMargolin - Contact Us Form";
            ListDictionary replacements = new ListDictionary();
            replacements.Add("<% Name %>", this.txtName.Text);
            replacements.Add("<% PhoneOrEmail %>", this.txtPhoneOrEmail.Text);
            replacements.Add("<% Message %>", this.txtMessage.Text);
            MailMessage msgHtml = message.CreateMailMessage(RECIPIENTS, replacements, new LiteralControl());
            try
            {
                client.Send(msgHtml);
                this.lblMsg.Text = "Your message has been sent and will be address shortly";
                this.lbSend.Enabled = false;
            }
            catch (Exception)
            {
                this.lblMsg.Text = "There was a problem to send an email.";
            }
        }
開發者ID:shaileshgajula,項目名稱:c8a5b00a-1d86-40ff-a172-35d865eeec09,代碼行數:26,代碼來源:ContactUs.aspx.cs

示例15: GetDeliveryOrdersDetailsTotals

 public virtual IDataReader GetDeliveryOrdersDetailsTotals(string DeliveryOrderNoFrom, string DeliveryOrderNoTo)
 {
     ListDictionary parameters = new ListDictionary();
     parameters.Add(new SqlParameter("@DeliveryOrderNoFrom", SqlDbType.NVarChar, 10), DeliveryOrderNoFrom);
     parameters.Add(new SqlParameter("@DeliveryOrderNoTo", SqlDbType.NVarChar, 10), DeliveryOrderNoTo);
     return LoadFromSqlReader("GetDeliveryOrdersDetailsTotals", parameters);
 }
開發者ID:menasbeshay,項目名稱:ivalley-svn,代碼行數:7,代碼來源:DeliveryOrder.cs


注:本文中的System.Collections.Specialized.ListDictionary.Add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。