示例#1
0
		internal string ReadSettingString(SettingsNameEnum valuename)
		{
			DSSettings.SettingsRow[] rows = (DSSettings.SettingsRow[])
				ds.Settings.Select("Name='" + valuename.ToString() + "'");

			if (rows.Length == 0)
			{
				return null;
			}
			else
			{
				return rows[0].Content;
			}
		}
示例#2
0
		internal void WriteSetting(SettingsNameEnum valuename, string valuecontent)
		{
			DSSettings.SettingsRow[] rows = (DSSettings.SettingsRow[])
				ds.Settings.Select("Name='" + valuename.ToString() + "'");

			if (rows.Length == 0)
			{
				DSSettings.SettingsRow row = (DSSettings.SettingsRow)
					ds.Settings.NewRow();
				row.Name = valuename.ToString();
				row.Content = valuecontent;
				ds.Settings.AddSettingsRow(row);
			}
			else
			{
				DSSettings.SettingsRow row = rows[0];
				row.Content = valuecontent;
			}

			ds.WriteXml(fileName);
		}