Click here to Skip to main content
15,860,859 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do I make table data red in <td>? Pin
Richard Deeming9-Mar-20 9:53
mveRichard Deeming9-Mar-20 9:53 
GeneralRe: How do I make table data red in <td>? Pin
Member 114033049-Mar-20 11:45
Member 114033049-Mar-20 11:45 
GeneralRe: How do I make table data red in <td>? Pin
Richard Deeming10-Mar-20 0:14
mveRichard Deeming10-Mar-20 0:14 
GeneralRe: How do I make table data red in <td>? Pin
Member 1140330412-Mar-20 4:08
Member 1140330412-Mar-20 4:08 
QuestionHow to capture credentials / auth token from Windows credential popup dialog? Pin
S p k 5214-Mar-20 0:27
S p k 5214-Mar-20 0:27 
AnswerRe: How to capture credentials / auth token from Windows credential popup dialog? Pin
Richard MacCutchan4-Mar-20 0:37
mveRichard MacCutchan4-Mar-20 0:37 
GeneralRe: How to capture credentials / auth token from Windows credential popup dialog? Pin
S p k 5214-Mar-20 2:03
S p k 5214-Mar-20 2:03 
Questionforeach loop behavior C# Pin
picasso22-Mar-20 18:55
picasso22-Mar-20 18:55 
Hello  experts
I have this behavior that I cannot figure it out.  The following code loops through and extracts some firewall settings.  It is triggered by a button

try
{

Type typeFWPolicy2 = Type.GetTypeFromProgID("HNetCfg.FwPolicy2");
INetFwPolicy2 fwPolicy2 = (INetFwPolicy2)Activator.CreateInstance(typeFWPolicy2);

foreach (INetFwRule rule in fwPolicy2.Rules)
	{
	lvItems.RuleName = rule.Name; ;
	lvItems.RemoteAddress = rule.RemoteAddresses;
	lvItems.Protocol = rule.Protocol.ToString();
	lvItems.LocalPort = rule.LocalPorts;
	dataGrid1.Items.Add(lvItems);
	//MessageBox.Show("close me");
}


}
catch (Exception ex)
{

MessageBox.Show("something went wrong");

}
When I run it, the datagrid is populated with the same record (only the first) entry that is repeated several times.
then I added a MessageBox to troubleshoot, then  Datagrid is populated correctly but I need to acknowledge each Messagebox !!!!.  It is like it just needs that extra mouse click.
any help is greatly appreciated  

AnswerRe: foreach loop behavior C# Pin
Pete O'Hanlon2-Mar-20 20:17
subeditorPete O'Hanlon2-Mar-20 20:17 
AnswerRe: foreach loop behavior C# Pin
OriginalGriff2-Mar-20 20:23
mveOriginalGriff2-Mar-20 20:23 
AnswerRe: foreach loop behavior C# Pin
lmoelleb3-Mar-20 23:01
lmoelleb3-Mar-20 23:01 
QuestionIgroupping with Parallel Pin
Member 110035101-Mar-20 6:58
Member 110035101-Mar-20 6:58 
AnswerRe: Igroupping with Parallel Pin
Dave Kreskowiak1-Mar-20 7:39
mveDave Kreskowiak1-Mar-20 7:39 
GeneralRe: Igroupping with Parallel Pin
Member 110035101-Mar-20 7:46
Member 110035101-Mar-20 7:46 
GeneralRe: Igroupping with Parallel Pin
Dave Kreskowiak1-Mar-20 7:50
mveDave Kreskowiak1-Mar-20 7:50 
GeneralRe: Igroupping with Parallel Pin
Member 110035101-Mar-20 18:28
Member 110035101-Mar-20 18:28 
AnswerRe: Igroupping with Parallel Pin
Luc Pattyn1-Mar-20 9:04
sitebuilderLuc Pattyn1-Mar-20 9:04 
GeneralRe: Igroupping with Parallel Pin
Member 110035101-Mar-20 18:36
Member 110035101-Mar-20 18:36 
GeneralRe: Igroupping with Parallel Pin
Pete O'Hanlon1-Mar-20 21:21
subeditorPete O'Hanlon1-Mar-20 21:21 
GeneralRe: Igroupping with Parallel Pin
Member 110035101-Mar-20 22:17
Member 110035101-Mar-20 22:17 
GeneralRe: Igroupping with Parallel Pin
Pete O'Hanlon1-Mar-20 22:42
subeditorPete O'Hanlon1-Mar-20 22:42 
GeneralRe: Igroupping with Parallel Pin
Richard Deeming1-Mar-20 23:57
mveRichard Deeming1-Mar-20 23:57 
Generaladd DISTINCT drop PARALLEL Pin
Luc Pattyn2-Mar-20 0:48
sitebuilderLuc Pattyn2-Mar-20 0:48 
Generaldrop TOLIST, avoid memory stress Pin
Luc Pattyn2-Mar-20 9:13
sitebuilderLuc Pattyn2-Mar-20 9:13 
AnswerRe: Igroupping with Parallel Pin
Eddy Vluggen1-Mar-20 13:47
professionalEddy Vluggen1-Mar-20 13:47 

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.