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


C# StringList.ToString方法代码示例

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


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

示例1: CreateTempUploadFile

        public override int CreateTempUploadFile(int userID, string uploadAction, string searchInfo, StringList customParamList, string filename, string serverFileName, string md5, long fileSize, string fileID)
        {
            int tempUploadFileID;

            using (SqlQuery query = new SqlQuery())
            {
                query.CommandType = CommandType.StoredProcedure;
                query.CommandText = "bx_CreateTempUploadFile";

                query.CreateParameter<int>("@UserID", userID, SqlDbType.Int);
                query.CreateParameter<string>("@UploadAction", uploadAction, SqlDbType.VarChar, 100);
                query.CreateParameter<string>("@SearchInfo", searchInfo, SqlDbType.NVarChar, 100);
                query.CreateParameter<string>("@CustomParams", customParamList.ToString(), SqlDbType.NVarChar, 3000);
                query.CreateParameter<string>("@FileName", filename, SqlDbType.NVarChar, 256);
                query.CreateParameter<string>("@ServerFileName", serverFileName, SqlDbType.VarChar, 100);
                query.CreateParameter<string>("@MD5", md5, SqlDbType.Char, 32);
                query.CreateParameter<long>("@FileSize", fileSize, SqlDbType.Int);
                query.CreateParameter<string>("@FileID", fileID, SqlDbType.VarChar, 50);
                SqlParameter returnParam = query.CreateParameter<int>("@TempUploadFileID", SqlDbType.Int, ParameterDirection.Output);
                query.ExecuteNonQuery();

                tempUploadFileID = (int)returnParam.Value;
            }

            return tempUploadFileID;
        }
开发者ID:huchao007,项目名称:bbsmax,代码行数:26,代码来源:FileDao.cs

示例2: GetValue

        public string GetValue()
        {
            StringTable table = new StringTable();

            //table.Add("LimitType", LimitType.ToString());
            table.Add("LimitType", ((byte)LimitType).ToString());


            foreach (KeyValuePair<Guid, List<Guid>> item in ExcludeRoles)
            {

                if (item.Value != null)
                {

                    StringList roles = new StringList();
                    foreach (Guid roleID in item.Value)
                    {
                        roles.Add(roleID.ToString());
                    }

                    table.Add("ExcludeRoles-" + item.Key.ToString("N"), roles.ToString());

                }

            }

            return table.ToString();
        }
开发者ID:huchao007,项目名称:bbsmax,代码行数:28,代码来源:PermissionLimit.cs

示例3: ToStringTest

        public void ToStringTest()
        {
            StringList target = new StringList();
            // empty list
            string expected = string.Empty;
            string actual = target.ToString();
            Assert.AreEqual(expected, actual);

            // 1 item in list
            target.Add("test1");
            expected = "test1";
            actual = target.ToString();
            Assert.AreEqual(expected, actual);

            // 2 items in list
            target.Add("test2");
            expected = "test1,test2"; 
            actual = target.ToString();
            Assert.AreEqual(expected, actual);
        }
开发者ID:vpuhoff,项目名称:sphinx-dotnet-client,代码行数:20,代码来源:StringList_UnitTest.cs

示例4: GetCalendarItemsDetailed


//.........这里部分代码省略.........
            dcOptAttendees.Caption = "OptAttendees";
            dcOptAttendees.ColumnName = "OptAttendees";
            dcOptAttendees.DefaultValue = "";
            // Add the column to the table.
            table.Columns.Add(dcOptAttendees);

            DataColumn dcId = new DataColumn();
            dcId.DataType = System.Type.GetType("System.String");
            dcId.AllowDBNull = true;
            dcId.Caption = "Id";
            dcId.ColumnName = "Id";
            dcId.DefaultValue = "";
            // Add the column to the table.
            table.Columns.Add(dcId);

            #endregion

            // Add rows and set values.
            DataRow row;

            //load properties
            List<Item> items = new List<Item>();
            if (myAppointments.Items.Count > 0)
            {
                foreach (Appointment a in myAppointments)
                {
                    items.Add(a);
                }
            }
            service.LoadPropertiesForItems(items, PropertySet.FirstClassProperties);

            ////Write out the subject of each appointment I have this week
            foreach (Appointment appointment in myAppointments)
            {
                string openItemUrl = ItemUrlProtocol + service.Url.Host + ItemUrlFolder + appointment.WebClientReadFormQueryString;

                row = table.NewRow();
                row["Subject"] = cleanHighAsciiForXML(appointment.Subject);
                row["Location"] = cleanHighAsciiForXML(appointment.Location);
                row["Start"] = appointment.Start;
                row["End"] = appointment.End;
                row["Body"] = appointment.Body.Text;
                row["Categories"] = appointment.Categories;
                row["Id"] = appointment.Id;

                //required attendees
                AttendeeCollection req = appointment.RequiredAttendees;
                StringList tmp = new StringList();
                foreach (Attendee att in req)
                {
                    tmp.Add(att.Address);
                }
                row["ReqAttendees"] = tmp.ToString();

                //optional attendees
                AttendeeCollection opt = appointment.OptionalAttendees;
                tmp = new StringList();
                foreach (Attendee att in opt)
                {
                    tmp.Add(att.Address);
                }
                row["OptAttendees"] = tmp.ToString();

                try
                {
                    row["AllDay"] = appointment.IsAllDayEvent.ToString();
                }
                catch (Exception e)
                {
                    row["AllDay"] = false; //default to false
                }
                row["Link"] = openItemUrl;

                // Be sure to add the new row to the
                // DataRowCollection.
                table.Rows.Add(row);
            }

            rsp.TableData = table;
        }
        catch (Exception e)
        {
            if (!(int.TryParse(e.Message, out rsp.StatusCode)))
            {
                //if the parsing fails, then set a default value of 500
                rsp.StatusCode = 500;
            }
            rsp.Msg = e.Message;

            success = false;
            miscData = "{ \"ErrMsg\":\"" + rsp.Msg + "\" }";
            rsp.StackTrace = e.StackTrace;
            if (e.InnerException != null) { rsp.InnerException = e.InnerException.ToString(); }
        }

        //audit
        addAuditLog(apiKey, emlUserAddress, "GetCalendarItems", success, miscData);

        return rsp;
    }
开发者ID:wharton,项目名称:Envelope,代码行数:101,代码来源:WhartonEWS.cs

示例5: DeleteSearch

        private void DeleteSearch()
		{
			StringList param = new StringList();

			param.Add(m_AdminForm.ToString());
			param.Add(_Request.Get("updatePoint", Method.Post, "1"));
			param.Add(_Request.Get("deleteArticle", Method.Post, "1"));

			TaskManager.BeginTask(MyUserID, new DeleteBlogCategoryTask(), param.ToString());
        }
开发者ID:huchao007,项目名称:bbsmax,代码行数:10,代码来源:manage-blogcategory.aspx.cs

示例6: DeleteBySearch

        private void DeleteBySearch()
		{
			StringList param = new StringList();

			param.Add(m_Filter.ToString());
			param.Add(_Request.Get("updatePoint", Method.Post, "1"));

			TaskManager.BeginTask(MyUserID, new DeleteCommentTask(), param.ToString());
        }
开发者ID:huchao007,项目名称:bbsmax,代码行数:9,代码来源:manage-comment.aspx.cs

示例7: ProcessStringList

		static void ProcessStringList(ProjectState state, IO.XmlStream s, Dictionary<string, StringList> listDic,
			string elementName, string listTypeName)
		{
			foreach (XmlNode n in s.Cursor.ChildNodes)
			{
				if (n.Name != elementName) continue;

				s.SaveCursor(n);
				var list = new StringList(state, s);
				s.RestoreCursor();
				string name_str = list.ToString();

				try { listDic.Add(name_str, list); }
				catch (ArgumentException) { Debug.LogFile.WriteLine(kDuplicateErrorStr, listTypeName, name_str); }
			}
		}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:16,代码来源:Import_Tags.cs

示例8: op_ToString_whenSingleItem

        public void op_ToString_whenSingleItem()
        {
            var expected = "example" + Environment.NewLine;

            var obj = new StringList
                          {
                              "example"
                          };
            var actual = obj.ToString();

            Assert.Equal(expected, actual);
        }
开发者ID:KarlDirck,项目名称:cavity,代码行数:12,代码来源:StringList.Facts.cs

示例9: op_ToString_whenMultipleItems

        public void op_ToString_whenMultipleItems()
        {
            var expected = "123{0}456{0}".FormatWith(Environment.NewLine);

            var obj = new StringList
                          {
                              "123",
                              "456"
                          };
            var actual = obj.ToString();

            Assert.Equal(expected, actual);
        }
开发者ID:KarlDirck,项目名称:cavity,代码行数:13,代码来源:StringList.Facts.cs

示例10: ApproveSearchResult

        private void ApproveSearchResult()
        {
            TopicFilter filter = TopicForm;//TopicFilter.GetFromFilter("filter");

            StringList param = new StringList();

            param.Add(filter.ToString());

            if (TaskManager.BeginTask(MyUserID, new ApproveTopicTask(), param.ToString()))
            {

            }
        }
开发者ID:huchao007,项目名称:bbsmax,代码行数:13,代码来源:manage-unapprovedtopic.aspx.cs

示例11: DeletedSearchResult

        private void DeletedSearchResult()
        {
            TopicFilter filter = TopicForm;//TopicFilter.GetFromFilter("filter");

            StringList param = new StringList();

            param.Add(filter.ToString());
            param.Add(_Request.Get("updatePoint", Method.Post, "1"));

            if (TaskManager.BeginTask(MyUserID, new DeleteTopicTask(), param.ToString()))
            {
                
            }
        }
开发者ID:huchao007,项目名称:bbsmax,代码行数:14,代码来源:manage-unapprovedtopic.aspx.cs

示例12: ProcessFile

		/// <summary>
		/// Process a XML file containing CheApe definitions
		/// </summary>
		/// <param name="state"></param>
		/// <param name="s"></param>
		private void ProcessFile(ProjectState state, BlamLib.IO.XmlStream s)
		{
			int complexity = 1 + 
				PreprocessXmlNodeComplexity();

			BlamVersion def_engine = BlamVersion.Unknown;
			s.ReadAttribute("game", ref def_engine);
			if (def_engine != state.Definition.Engine)
			{
				Debug.Assert.If(false, "CheApe definition '{0}' is for {1}. Expected a {2} definition.", s.FileName, def_engine, state.Definition.Engine);
			}
			else
			{
				string name_str;
				foreach (XmlNode n in s.Cursor.ChildNodes)
				{
					switch (n.Name)
					{
						#region Enums
						case "enums":
							s.SaveCursor(n);
							foreach (XmlNode n2 in s.Cursor.ChildNodes)
							{
								if (n2.Name != "Enum") continue;

								s.SaveCursor(n2);
								StringList list = new StringList(state, s);
								s.RestoreCursor();
								name_str = list.ToString();

								try { Enums.Add(name_str, list); }
								catch (ArgumentException) { Debug.LogFile.WriteLine(kDuplicateErrorStr, "enum definition", name_str); }
							}
							s.RestoreCursor();
							break;
						#endregion

						#region Flags
						case "flags":
							s.SaveCursor(n);
							foreach (XmlNode n2 in s.Cursor.ChildNodes)
							{
								if (n2.Name != "Flag") continue;

								s.SaveCursor(n2);
								StringList list = new StringList(state, s);
								s.RestoreCursor();
								name_str = list.ToString();

								try { Flags.Add(name_str, list); }
								catch (ArgumentException) { Debug.LogFile.WriteLine(kDuplicateErrorStr, "flag definition", name_str); }
							}
							s.RestoreCursor();
							break;
						#endregion

						#region Tag References
						case "references":
							s.SaveCursor(n);
							foreach (XmlNode n2 in s.Cursor.ChildNodes)
							{
								if (n2.Name != "Reference") continue;

								s.SaveCursor(n2);
								TagReference tagref = new TagReference(state, s);
								s.RestoreCursor();
								name_str = tagref.ToString();

								try { References.Add(name_str, tagref); }
								catch (ArgumentException) { Debug.LogFile.WriteLine(kDuplicateErrorStr, "tag reference definition", name_str); }
							}
							s.RestoreCursor();
							break;
						#endregion

						#region Tag Data
						case "data":
							s.SaveCursor(n);
							foreach (XmlNode n2 in s.Cursor.ChildNodes)
							{
								if (n2.Name != "TagData") continue;

								s.SaveCursor(n2);
								TagData tagdata = new TagData(state, s);
								s.RestoreCursor();
								name_str = tagdata.ToString();

								try { Data.Add(name_str, tagdata); }
								catch (ArgumentException) { Debug.LogFile.WriteLine(kDuplicateErrorStr, "tag data definition", name_str); }
							}
							s.RestoreCursor();
							break;
						#endregion

						#region Script Functions
//.........这里部分代码省略.........
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:101,代码来源:Import.cs


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