Click here to Skip to main content
15,887,477 members
Home / Discussions / C#
   

C#

 
GeneralRe: run a method after getting a reponse it is done Pin
Anthony Mushrow9-Oct-08 10:31
professionalAnthony Mushrow9-Oct-08 10:31 
QuestionVisual Studio 2008 - Report Viewer does show on WinForm Pin
tkmarshall9-Oct-08 9:05
tkmarshall9-Oct-08 9:05 
AnswerRe: Visual Studio 2008 - Report Viewer does show on WinForm Pin
Wendelius9-Oct-08 9:44
mentorWendelius9-Oct-08 9:44 
GeneralRe: Visual Studio 2008 - Report Viewer does show on WinForm Pin
tkmarshall9-Oct-08 10:55
tkmarshall9-Oct-08 10:55 
GeneralRe: Visual Studio 2008 - Report Viewer does show on WinForm Pin
Wendelius9-Oct-08 11:00
mentorWendelius9-Oct-08 11:00 
GeneralRe: Visual Studio 2008 - Report Viewer does show on WinForm Pin
tkmarshall10-Oct-08 4:58
tkmarshall10-Oct-08 4:58 
GeneralRe: Visual Studio 2008 - Report Viewer does show on WinForm Pin
Wendelius10-Oct-08 6:38
mentorWendelius10-Oct-08 6:38 
QuestionApp.Config Encrypt section, not saving Pin
Bill Warner9-Oct-08 8:12
Bill Warner9-Oct-08 8:12 
Hi,

I'm having difficulty getting a section of an app.config file to show as encrypted. I run the code and get no errors, but the section does not encrypt. Any help would be appreciated, I've tried other implementations from other posts here with same results:

using System;
using System.Windows.Forms;
using System.Configuration;

namespace AppConfigRedux
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnUnprotect_Click(object sender, EventArgs e)
{
UnProtectSection("connectionStrings");
}

private void btnProtect_Click(object sender, EventArgs e)
{
ProtectSection("connectionStrings", "DataProtectionConfigurationProvider");
}

private void ProtectSection(string sectionName, string provider)
{
Configuration config = ConfigurationManager.OpenExeConfiguration(System.Windows.Forms.Application.ExecutablePath);
ConfigurationSection section = config.GetSection(sectionName);

if (section != null && !section.SectionInformation.IsProtected)
{
section.SectionInformation.ProtectSection(provider);
config.Save();
}
}

private void UnProtectSection(string sectionName)
{
Configuration config = ConfigurationManager.OpenExeConfiguration(System.Windows.Forms.Application.ExecutablePath);
ConfigurationSection section = config.GetSection(sectionName);

if (section != null && section.SectionInformation.IsProtected)
{
section.SectionInformation.UnprotectSection();
config.Save();
}
}
}
}
QuestionAnonymous constructor for Dictionary Pin
ezazazel9-Oct-08 7:50
ezazazel9-Oct-08 7:50 
AnswerRe: Anonymous constructor for Dictionary Pin
Daniel Grunwald9-Oct-08 8:02
Daniel Grunwald9-Oct-08 8:02 
GeneralRe: Anonymous constructor for Dictionary Pin
ezazazel9-Oct-08 8:04
ezazazel9-Oct-08 8:04 
Questionsummation Pin
Monin D.9-Oct-08 7:11
Monin D.9-Oct-08 7:11 
AnswerRe: summation Pin
Dan Neely9-Oct-08 7:18
Dan Neely9-Oct-08 7:18 
AnswerRe: summation Pin
DaveyM699-Oct-08 7:53
professionalDaveyM699-Oct-08 7:53 
AnswerRe: summation Pin
ezazazel9-Oct-08 8:03
ezazazel9-Oct-08 8:03 
GeneralRe: summation Pin
Monin D.9-Oct-08 11:09
Monin D.9-Oct-08 11:09 
AnswerRe: summation Pin
#realJSOP9-Oct-08 8:48
mve#realJSOP9-Oct-08 8:48 
GeneralRe: summation Pin
Dan Neely9-Oct-08 9:02
Dan Neely9-Oct-08 9:02 
GeneralRe: summation Pin
Ennis Ray Lynch, Jr.9-Oct-08 10:12
Ennis Ray Lynch, Jr.9-Oct-08 10:12 
GeneralRe: summation Pin
Mark Churchill9-Oct-08 17:07
Mark Churchill9-Oct-08 17:07 
AnswerRe: summation Pin
User 66589-Oct-08 21:55
User 66589-Oct-08 21:55 
QuestionDealing with ColorPalette problem in C# forms. Pin
OCrowley9-Oct-08 6:06
OCrowley9-Oct-08 6:06 
QuestionRe: Dealing with ColorPalette problem in C# forms. Pin
led mike9-Oct-08 6:09
led mike9-Oct-08 6:09 
AnswerRe: Dealing with ColorPalette problem in C# forms. Pin
OCrowley9-Oct-08 6:25
OCrowley9-Oct-08 6:25 
GeneralRe: Dealing with ColorPalette problem in C# forms. Pin
led mike9-Oct-08 7:01
led mike9-Oct-08 7:01 

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.