1
I’m kind of a Noob in c#
and would like help on an application I’m running.
In this application I need user settings to stay Default, but I don’t know a way to do it.
I am developing in Webforms.
Can someone help me ?
An excerpt from what I tried to do:
private void PostTask(HttpClient client)
{
client.PostAsync("http://kronos/dotproject/index.php?m=tasks&a=view&task_id=1393",
new FormUrlEncodedContent(new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>("dosql", "do_updatetask"),
new KeyValuePair<string, string>("task_log_task", (cmbTasks.SelectedItem as Task).IdTask.Substring(43)),
new KeyValuePair<string, string>("task_log_creator", lblNome.Text),
new KeyValuePair<string, string>("task_log_name", cmbTasks.Text),
new KeyValuePair<string, string>("task_log_date", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
new KeyValuePair<string, string>("task_log_hours", cmbHoras.Text),
new KeyValuePair<string, string>("task_log_description", Descricao.Text),
new KeyValuePair<string, string>("email_assignees", "on"),
new KeyValuePair<string, string>("email_task_contacts", "on"),
new KeyValuePair<string, string>("email_project_contacts", "on")
})).Wait();
Properties.Settings.Default.Save();
/*var settings = Properties.Settings.Default;
settings.SettingsKey = "value";
settings.Save(); */
}
So Vanessa, I think your question is a little vague... What does your system do? What are these settings? Give a little more detail, if possible, snippets of code you find pertinent to make it easier.
– Érik Thiago
So... he sends a post from a form containing information that is available to the user, I just need to make an exception because certain users always do the same thing on this form... so to make it easier I’d like to leave this information standardized but I don’t know how to do it. An excerpt from what I tried to do :
– Vanessa Rodrigues
opa ! could not send ^^'
– Vanessa Rodrigues
Besides being c#, what more technology do you use ? MVC, Windows Forms, Web Forms, Webapi... ? Try to detail the information as much as possible. What you couldn’t send ?
– Érik Thiago
My code... but I edited my question with the excerpt I wanted to send
– Vanessa Rodrigues
That’s good, but you’re doing the system in Webforms ?
– Érik Thiago
Yes that’s right !
– Vanessa Rodrigues
managed to fix? I believe you can make a login screen before making the requests and then save this data for the other days
– Luiz Paulo Lindenmaier