Click here to Skip to main content
15,924,452 members
Home / Discussions / C#
   

C#

 
QuestionPC - Ethernet - Ethernet/RS232 changer - µC Pin
suam11112-Sep-07 11:12
suam11112-Sep-07 11:12 
AnswerRe: PC - Ethernet - Ethernet/RS232 changer - µC Pin
Dave Kreskowiak12-Sep-07 13:33
mveDave Kreskowiak12-Sep-07 13:33 
AnswerRe: PC - Ethernet - Ethernet/RS232 changer Pin
Luc Pattyn12-Sep-07 14:31
sitebuilderLuc Pattyn12-Sep-07 14:31 
GeneralRe: PC - Ethernet - Ethernet/RS232 changer - µC Pin
Dave Kreskowiak12-Sep-07 15:01
mveDave Kreskowiak12-Sep-07 15:01 
QuestionTopMost visible and BottomMost visible rows in DataGrid Pin
zaboboa12-Sep-07 10:26
zaboboa12-Sep-07 10:26 
QuestionSend PAGEDOWN Message to DataGrid, when DataGrid does not have focus. Pin
zaboboa12-Sep-07 9:55
zaboboa12-Sep-07 9:55 
QuestionlistBox event - strange behavior [modified] Pin
kboyette12-Sep-07 9:51
kboyette12-Sep-07 9:51 
QuestionHelp please! About Listview and .txt file Pin
andredani12-Sep-07 9:38
andredani12-Sep-07 9:38 
the question are:
i add this into a listview
string ett = "1";
string u = comboBox1.Text;
string q = textBox1.Text;
string w = textBox2.Text;
DateTime dt = DateTime.Now;

if (q.Length > 0 && w.Length > 0 && u.Length > 0)
{
if (this != null)
{
string time = dt.ToString("dd");
string name = this.textBox1.Text + time.ToString() + ett;

ListViewItem item = new ListViewItem(new string[] { u, name, dt.ToString(), this.textBox2.Text });

ListViewIns.Items.Add(item);

But string u and name can not be equal with something else in a .txt file
for example
string u = Online
name = k431121

And the .txt file look like this:
#
online
k431121
blah
blah

If they two string match with line[index +1] an line[index +2] then add +1 on k431121. So in this example they match it will add +1 and look like this
#
online
k431121
blah
blah
#
online
k431122
blah
blah

I have a code but it don´t want to work:
private List<string> Entries;
private void LoadEntries()
{
string key;
Entries=new List<string>();
foreach (ListViewItem item in listView1.Items)
{
key = string.Concat(item.SubItems[0], "@@", item.SubItems[1]);
if (!Entries.Contains(key))
Entries.Add(key);
}
}
private void PopulateListView(List<string> list)
{
LoadEntries();
listView1.View = View.Details;
listView1.Columns.Add("Kolumn1");
listView1.Columns.Add("Kolumn2");
listView1.Columns.Add("Kolumn3");
listView1.Columns.Add("Kolumn4");
listView1.Columns.Add("Kolumn5");
string Name,No,key;
int n;
for (int i = 0; i < list.Count; i += 5)
{
Name = list[i+1];
No = list[i + 2];
while(Entries.Contains(key = string.Concat(Name, "@@", No)))
{
n = Convert.ToInt32(No.Substring(No.Length - 1));
No = String.Concat(No.Substring(0, No.Length - 1), n + 1);

}
if (!Entries.Contains(key))
Entries.Add(key);
ListViewItem item = new ListViewItem(list[i]);
item.SubItems.Add(Name);
item.SubItems.Add(No);
item.SubItems.Add(list[i + 3]);
item.SubItems.Add(list[i + 4]);
listView1.Items.Add(item);
}
}

My question is: can you help me build this together..???Sigh | :sigh:
Smile | :) Big Grin | :-D Laugh | :laugh:
Thanks////
QuestionDataGridView update Pin
ss.mmm12-Sep-07 8:59
ss.mmm12-Sep-07 8:59 
AnswerRe: DataGridView update Pin
mertkan6512-Sep-07 20:47
mertkan6512-Sep-07 20:47 
QuestionAdd hyperlink to datagridview column, who can help me? Pin
liujw12-Sep-07 8:31
liujw12-Sep-07 8:31 
AnswerRe: Add hyperlink to datagridview column, who can help me? Pin
Judah Gabriel Himango12-Sep-07 9:10
sponsorJudah Gabriel Himango12-Sep-07 9:10 
AnswerRe: Add hyperlink to datagridview column, who can help me? Pin
Malcolm Smart13-Sep-07 3:19
Malcolm Smart13-Sep-07 3:19 
QuestionConversion Pin
rowdykuttan12-Sep-07 8:03
rowdykuttan12-Sep-07 8:03 
AnswerRe: Conversion Pin
Matthew Cuba12-Sep-07 8:07
Matthew Cuba12-Sep-07 8:07 
GeneralRe: Conversion Pin
Pete O'Hanlon12-Sep-07 8:58
mvePete O'Hanlon12-Sep-07 8:58 
GeneralRe: Conversion Pin
PIEBALDconsult12-Sep-07 9:01
mvePIEBALDconsult12-Sep-07 9:01 
GeneralRe: Conversion Pin
Matthew Cuba12-Sep-07 9:07
Matthew Cuba12-Sep-07 9:07 
AnswerRe: Conversion Pin
Wes Aday12-Sep-07 10:23
professionalWes Aday12-Sep-07 10:23 
GeneralRe: Conversion Pin
Christian Graus12-Sep-07 13:48
protectorChristian Graus12-Sep-07 13:48 
AnswerRe: Conversion Pin
Paras Kaneriya12-Sep-07 20:54
Paras Kaneriya12-Sep-07 20:54 
QuestionCount Decimals Pin
keyboard warrior12-Sep-07 7:23
keyboard warrior12-Sep-07 7:23 
AnswerRe: Count Decimals Pin
Sean Michael Murphy12-Sep-07 7:33
Sean Michael Murphy12-Sep-07 7:33 
AnswerRe: Count Decimals Pin
PIEBALDconsult12-Sep-07 7:57
mvePIEBALDconsult12-Sep-07 7:57 
GeneralRe: Count Decimals Pin
keyboard warrior12-Sep-07 8:04
keyboard warrior12-Sep-07 8:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.