User settings

Asked

Viewed 56 times

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.

  • 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 :

  • opa ! could not send ^^'

  • 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 ?

  • My code... but I edited my question with the excerpt I wanted to send

  • That’s good, but you’re doing the system in Webforms ?

  • Yes that’s right !

  • managed to fix? I believe you can make a login screen before making the requests and then save this data for the other days

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.