本文整理汇总了C#中System.Collections.Specialized.StringCollection.Add方法的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.Specialized.StringCollection.Add方法的具体用法?C# System.Collections.Specialized.StringCollection.Add怎么用?C# System.Collections.Specialized.StringCollection.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.Specialized.StringCollection
的用法示例。
在下文中一共展示了System.Collections.Specialized.StringCollection.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadDatabase
private static void LoadDatabase()
{
//Connect to the server
var connectionString = "Data Source=localhost\\sqlexpress;Initial Catalog=master;Integrated Security=SSPI";
var con = new SqlConnection(connectionString);
ServerConnection serverConnection = new ServerConnection(con);
Server sqlServer = new Server(serverConnection);
System.IO.FileInfo mdf = new System.IO.FileInfo(@"Buzzle.mdf");
System.IO.FileInfo ldf = new System.IO.FileInfo(@"Buzzle_log.LDF");
var dbPath = sqlServer.MasterDBPath;
var databasePath = dbPath + @"\Buzzle.mdf";
var databaseLogPath = dbPath + @"\Buzzle_log.LDF";
File.Copy(mdf.FullName, databasePath, true);
File.Copy(ldf.FullName, databaseLogPath, true);
var databasename = mdf.Name.ToLower().Replace(@".mdf", @"");
System.Collections.Specialized.StringCollection databasefiles = new System.Collections.Specialized.StringCollection();
databasefiles.Add(databasePath);
databasefiles.Add(databaseLogPath);
sqlServer.AttachDatabase(databasename, databasefiles);
}
示例2: executeTest
public override void executeTest( )
{
Holodeck.HolodeckProcess.Start ();
Holodeck.HolodeckPane.File_NewProject ();
Holodeck.NewProjectPane1.Reset ();
Holodeck.NewProjectPane1.SetProjectLocation ("C:\\LimitTest.hdp");
Holodeck.NewProjectPane1.Next ();
Holodeck.NewProjectPane2.Reset ();
string applicationToLaunchPath = System.Environment.SystemDirectory + "\\..\\notepad.exe";
Holodeck.NewProjectPane2.SetApplicationName (applicationToLaunchPath);
Holodeck.NewProjectPane2.Next ();
Holodeck.NewProjectPane3.Reset ();
Holodeck.NewProjectPane3.SetPauseApplication (true);
Holodeck.NewProjectPane3.Finish ();
Holodeck.HolodeckPane.SelectLimitsPane ();
Holodeck.HolodeckPane.Application_Resume ();
Holodeck.LimitsPane.SetDiskUnits (Holodeck.LimitsPane.Unit.Byte);
Holodeck.LimitsPane.SetDiskLimit(5); // Set Disk Limits to 5 bytes
System.Collections.Specialized.StringCollection keyList = new System.Collections.Specialized.StringCollection ();
keyList.Add ("1234567");
keyList.Add ("%f");
keyList.Add ("s");
keyList.Add ("c:\\1.txt");
keyList.Add ("{ENTER}");
System.Threading.Thread.Sleep (1000);
Holodeck.HolodeckProcess.SendKeysToApp ("Untitled - Notepad", keyList);
/*
try
{
keyList.Clear ();
keyList.Add ("{ENTER}");
Holodeck.HolodeckProcess.SendKeysToApp ("Notepad", keyList);
}
catch (Holodeck.HolodeckExceptions.CannotFindApplication e) // We couldn't find error dialog -> Holodeck didn't set the limits properly
{
// TODO: quit the application properly
// TODO: exit Holodeck
throw e;
}*/
}
示例3: Extract
public System.Collections.Specialized.StringCollection Extract()
{
String strPattern = "([A-Za-z0-9](([_\\.\\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\\.\\-]?[a-zA-Z0-9]+)*)\\.([A-Za-z]{2,}))";
System.Collections.Specialized.StringCollection collAddresses = new System.Collections.Specialized.StringCollection();
NodeFilter filter = new RegexFilter(strPattern, true);
NodeList nodes = m_obParser.Parse(filter);
if (null != nodes &&
0 != nodes.Size())
{
RegexOptions options = RegexOptions.IgnoreCase | RegexOptions.Multiline;
Regex obRegex = new Regex(strPattern, options);
for(Int32 i = 0; i < nodes.Size(); i++)
{
INode obNode = nodes.ElementAt(i);
String strText = obNode.GetText();
Match m = obRegex.Match(strText);
while(m.Success)
{
collAddresses.Add(m.Groups[0].Value);
// Advance to the next match.
m = m.NextMatch();
}
}
}
return collAddresses;
}
示例4: settings
public static ClientAPISettings settings()
{
var clientApiSettings = new ClientAPISettings();
//clientApiSettings.HTTPS_ADDRESS_FOR_FILE_TRANSFER = "localhost";
var checksumPillars = new System.Collections.Specialized.StringCollection { "checksum2" };
var pillars = new System.Collections.Specialized.StringCollection();
//pillars.Add("sbtape2");
//pillars.Add("reference2");
pillars.Add("jonas-testpillar");
pillars.Add("kims-testpillar");
//pillars.Add("kbpillar2");
clientApiSettings.CHECKSUMPILLAR_IDS = pillars;
clientApiSettings.CLIENT_ID = "Jonas-client";
clientApiSettings.CLIENT_QUEUE = @"queue://jonas_test_client";
//b.CLIENT_TOPIC_QUEUE = "topic://sa_test_client";
clientApiSettings.COLLECTION_DESTINATION = "topic://integrationtest1";
clientApiSettings.COLLECTION_ID = "integrationtest1";
//b.COLLECTION_SETTINGS_XSD_FILE_PATH = @"C:\BitMagStuff\xsdFiles\bitrepository-repository-settings-10\xsd\RepositorySettings.xsd";
//b.COMMON_QUEUE = "";
clientApiSettings.DEFAULT_CHECKSUM_TYPE = "MD5";
clientApiSettings.IDENTIFICATION_TIMEOUT = 7000;
clientApiSettings.MAX_EXECUTING_ITEMS = 10;
clientApiSettings.MAX_NUMBER_OF_REQUEST_RETRIES = 3;
clientApiSettings.MESSAGE_BUS_CONFIGURATION_NAME = "Integration Test Broker Network A";
clientApiSettings.MESSAGE_XSD_FILE_PATH = @"D:\bitrepository-message-xml-24\xsd\BitRepositoryMessages.xsd";
clientApiSettings.PILLAR_IDS = pillars;
const int port = 443;
//clientApiSettings.ACTIVEMQ_BROKER = @"ssl://localhost:61616?transport.clientcertfilename=D:/Downloads/Apache/apache-activemq-5.5.1/conf/client.cer&transport.acceptInvalidBrokerCert=true"; // grøntnet
clientApiSettings.ACTIVEMQ_BROKER = @"ssl://217.198.211.150:61616?transport.clientcertfilename=D:/Downloads/Apache/apache-activemq-5.5.1/conf/client.cer&transport.acceptInvalidBrokerCert=true";
//clientApiSettings.ACTIVEMQ_BROKER = @"tcp://localhost:61617";
clientApiSettings.TIME_TO_WAIT_AFTER_TIMEOUT = 10000;
clientApiSettings.VALID_FILENAME_REGEX = @"[a-zA-Z_\.\-0-9]+";
clientApiSettings.XML_NAMESPACE = "http://bitrepository.org/BitRepositoryMessages.xsd";
clientApiSettings.XSD_MINIMUM_VERSION = "24";
clientApiSettings.XSD_VERSION = "24";
clientApiSettings.OPERATION_TIMEOUT = 120000; // 2 min.
clientApiSettings.PRIVATE_CERTIFICATE_THUMBPRINT = "B60843F8A3BFBD2944EAF9043D9C2443B936A981";
clientApiSettings.PUBLIC_CERTIFICATE_THUMBPRINT = "B60843F8A3BFBD2944EAF9043D9C2443B936A981";
clientApiSettings.USER_CERTIFICATES_STORE = "My";
clientApiSettings.WEBDAV_HTTP_PORT = port;
clientApiSettings.WEBDAV_BASEFOLDERNAME = "dav";
clientApiSettings.WEBDAV_URI_SCHEME = "HTTPS";
clientApiSettings.WEBDAV_IP_ADDRESS = "217.198.211.150";
clientApiSettings.WEBDAV_CLIENT_CERTIFICATE_THUMBPRINT = "147cafe2c7d0b07d3a61653977a87ff7fe91f5c6";
return clientApiSettings;
}
示例5: CopyAsFile
private void CopyAsFile(System.Drawing.Imaging.ImageFormat format,
String FileExtension)
{
String temp = saveAsTempFile(format, FileExtension);
System.Collections.Specialized.StringCollection files = new
System.Collections.Specialized.StringCollection();
files.Add(temp);
Clipboard.SetFileDropList(files);
}
示例6: CSharpStringCollectionNotCompiles
public void CSharpStringCollectionNotCompiles()
{
Stream stream = GetCSharpBadSample();
using (StreamReader sr = new StreamReader(stream))
{
System.Collections.Specialized.StringCollection references = new System.Collections.Specialized.StringCollection();
references.Add("System.dll");
CompilerAssert.NotCompiles(CompilerAssert.CSharpCompiler, references, sr.ReadToEnd());
}
}
示例7: SaveBlacklist
public void SaveBlacklist()
{
System.Collections.Specialized.StringCollection blacklist = new System.Collections.Specialized.StringCollection();
foreach (String appid in lstBlacklist.Items)
{
blacklist.Add(appid);
}
Properties.Settings.Default.blacklist = blacklist;
Properties.Settings.Default.Save();
}
示例8: Form1
public Form1()
{
InitializeComponent();
// Init ListView and folder collection
folderCol = new System.Collections.Specialized.StringCollection();
CreateHeadersAndFillListView();
PaintListView(@"C:\");
folderCol.Add(@"C:\");
}
示例9: Form15
public Form15()
{
InitializeComponent();
// Init ListView and folder collection
folderCol = new System.Collections.Specialized.StringCollection();
CreateHeadersAndFillListView();
PaintListView(@"C:\");
folderCol.Add(@"C:\");
this.lwFilesAndFolders.ItemActivate += new System.EventHandler(this.lwFilesAndFolders_ItemActivate);
}
示例10: btnAddListValidation_Click
protected void btnAddListValidation_Click(object sender, EventArgs e)
{
// ExStart:AddListValidation
// Accessing the cells collection of the worksheet that is currently active
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex];
// Access "B1" cell and add some text
GridCell cell = sheet.Cells[0, 1];
cell.PutValue("Select Course:");
// Accessing "C1" cell
cell = sheet.Cells[0, 2];
// Creating List validation for the "C1" cell
var validation = cell.CreateValidation(GridValidationType.List, true);
// Adding values to List validation
var values = new System.Collections.Specialized.StringCollection();
values.Add("Fortran");
values.Add("Pascal");
values.Add("C++");
values.Add("Visual Basic");
values.Add("Java");
values.Add("C#");
validation.ValueList = values;
// ExEnd:AddListValidation
}
示例11: Apply
public void Apply()
{
System.Collections.Specialized.StringCollection sc = new System.Collections.Specialized.StringCollection();
foreach (ListViewItem lvi in listView1.Items)
{
if (lvi.Checked)
{
sc.Add(lvi.Tag as string);
}
}
Properties.Settings.Default.Startup = sc;
Properties.Settings.Default.Save();
}
示例12: BuildMultiColumnFilter
public static string BuildMultiColumnFilter(string filterExpression, DataColumnCollection coloumns)
{
System.Collections.Specialized.StringCollection coloumNames = new System.Collections.Specialized.StringCollection();
foreach (DataColumn col in coloumns)
{
coloumNames.Add(col.ColumnName);
}
return BuildMultiColumnFilter(filterExpression, coloumNames);
}
示例13: btnAddDropDownListValidation_Click
protected void btnAddDropDownListValidation_Click(object sender, EventArgs e)
{
// ExStart:AddDropDownListValidation
// Accessing the cells collection of the worksheet that is currently active
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex];
// Access "B1" cell and add some text
GridCell cell = sheet.Cells[0, 1];
cell.PutValue("Select Degree:");
// Accessing "C1" cell
cell = sheet.Cells[0, 2];
// Creating DropDownList validation for the "C1" cell
var validation = cell.CreateValidation(GridValidationType.DropDownList, true);
// Adding values to DropDownList validation
var values = new System.Collections.Specialized.StringCollection();
values.Add("Bachelor");
values.Add("Master");
values.Add("Doctor");
validation.ValueList = values;
// ExEnd:AddDropDownListValidation
}
示例14: button2_Click
private void button2_Click(object sender, EventArgs e)
{
Properties.Settings.Default.LowPumpSetting = textBox1.Text;
Properties.Settings.Default.MediumPumpSetting = textBox2.Text;
Properties.Settings.Default.HighPumpSetting = textBox3.Text;
System.Collections.Specialized.StringCollection pressures = new System.Collections.Specialized.StringCollection();
System.Collections.Specialized.StringCollection fluids = new System.Collections.Specialized.StringCollection();
//look at each item and see if there is something there to save
foreach (DataGridViewRow dRow in dataGridView2.Rows)
{
try
{
if (dRow.Cells[0].Value.ToString() != "" && dRow.Cells[1].Value.ToString() != "")
pressures.Add(dRow.Cells[0].Value.ToString() + ":" + dRow.Cells[1].Value.ToString());
}
catch (NullReferenceException ex)
{
//show error and return
//MessageBox.Show("Invalid entry for Pressure Unit on line " + (dRow.Index + 1).ToString() + "!", COMMS.Instance.appName, MessageBoxButtons.OK, MessageBoxIcon.Error);
//return;
}
}
//make sure we save any good values user has entered here too...
foreach (DataGridViewRow dRow in dataGridView3.Rows)
{
try
{
if (dRow.Cells[0].Value.ToString() != "" && dRow.Cells[1].Value.ToString() != "")
fluids.Add(dRow.Cells[0].Value.ToString() + ":" + dRow.Cells[1].Value.ToString());
}
catch (NullReferenceException ex)
{
//show error and return
//MessageBox.Show("Invalid entry for Fluid/viscosity on line " + (dRow.Index + 1).ToString() + "!", COMMS.Instance.appName, MessageBoxButtons.OK, MessageBoxIcon.Error);
//return;
}
}
Properties.Settings.Default.pressureUnits = pressures;
Properties.Settings.Default.fluids = fluids;
Properties.Settings.Default.COMM = comboBox1.Text;
Properties.Settings.Default.Save();
Close();
}
示例15: SaveModules
private void SaveModules()
{
System.Collections.Specialized.StringCollection modsettings = new System.Collections.Specialized.StringCollection();
foreach (ListViewItem lvw in lvwModules.Items)
{
String modstr = "";
foreach (ListViewItem.ListViewSubItem subitm in lvw.SubItems)
{
modstr += subitm.Text + "|";
}
if(modstr.Trim() != "")
{
modstr = modstr.Substring(0, modstr.Length - 1);
modsettings.Add(modstr);
}
}
Properties.Settings.Default["Modules"] = modsettings;
Properties.Settings.Default.Save();
Properties.Settings.Default.Reload();
}