Click here to Skip to main content
13,766,675 members

Windows API

 
AnswerRe: a small problem with function Pin
Graham Breach16-Mar-16 0:54
memberGraham Breach16-Mar-16 0:54 
PraiseRe: a small problem with function Pin
VISWESWARAN199816-Mar-16 10:10
professionalVISWESWARAN199816-Mar-16 10:10 
QuestionMicrosoft COM Pin
Stefan Bogdan11-Nov-15 23:35
memberStefan Bogdan11-Nov-15 23:35 
AnswerRe: Microsoft COM Pin
Richard Andrew x6412-Nov-15 4:12
professionalRichard Andrew x6412-Nov-15 4:12 
AnswerRe: Microsoft COM Pin
Eddy Vluggen12-Nov-15 4:25
professionalEddy Vluggen12-Nov-15 4:25 
AnswerRe: Microsoft COM Pin
Kunal Chowdhury «IN»4-Mar-16 0:01
mentorKunal Chowdhury «IN»4-Mar-16 0:01 
AnswerRe: Microsoft COM Pin
Munchies_Matt6-Apr-17 2:47
memberMunchies_Matt6-Apr-17 2:47 
QuestionClient Universall App WebApi Pin
Paolo Mazzon31-Oct-15 1:27
memberPaolo Mazzon31-Oct-15 1:27 
Hello I am trying to load data into a web API with a Universal app, but testing with Fiddler will not come out the data in the correct format

This should be the result:
{"IDBusta":4,"NomeCliente":"Fior","Prezzo":9.0}]


instead it comes so:
alue=%7B%22IDBusta%22%3A22%2C%22NomeCliente%22%3A%22fff%22%2C%22Prezzo%22%3A22.0%7D


this is the class on question:
 public sealed partial class CreateOrUpdate : Page
    {
        bool? create { get; set; }
        public CreateOrUpdate()
        {
            this.InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Must be a request to update
            // Because if the "create" is null or true, 
            // it is to denote that the request is to create a new object
            if (e.Parameter as bool? == false)
            {
                create = e.Parameter as bool?;
                var busta = App.ActiveBusta;
                TextBoxIdBusta.Text = busta.IDBusta.ToString();
                TextBoxNome.Text  = busta.NomeCliente.ToString();
                TextBoxPrezzo.Text = busta.Prezzo.ToString();
 
                actionButton.Content = "Update";
            }
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if ((sender as Button).Content.ToString() == "Home")
            {
                // Go to default page 
               this.Frame.Navigate(typeof(MainPage));
                return; // and cancel the event.
            }

            // Otherwise
            var busta = new Busta
            {
                IDBusta = Convert.ToInt32(TextBoxIdBusta.Text),
                NomeCliente   = TextBoxNome.Text.ToString(),
                Prezzo = float.Parse(TextBoxPrezzo.Text),
        };

            using (var client = new HttpClient())
            {
                var content = JsonConvert.SerializeObject(busta);

                if (create == null || create == true)
                {
                    // Send a POST
                    Task task = Task.Run(async () =>
                    {
                        var data = new HttpFormUrlEncodedContent(
                            new Dictionary<string, string>
                            {
                                ["value"] = content
                            }
                        );
                        await client.PostAsync(App.BaseUri, data);
                    });
                    task.Wait();
                }
                else
                {
                    // Send a PUT
                    Task task = Task.Run(async () =>
                    {
                        var data = new HttpFormUrlEncodedContent(
                            new Dictionary<string, string>
                            {
                                ["value"] = content,
                                ["id"] = App.ActiveBusta.IDBusta.ToString()
                            }
                        );
                        await client.PutAsync(App.BaseUri, data);
                    });
                    task.Wait();
                }
            }

           Frame.Navigate(typeof(MainPage));
        }
                
    }
}


this is the tutorial I'm Following:
ASP-NET-Web-API-RESTful-CRUDs-and-Windows-native

you have any other suggestions or tutorials?

thank you
AnswerRe: Client Universall App WebApi Pin
Richard Deeming2-Nov-15 3:17
mvpRichard Deeming2-Nov-15 3:17 
GeneralRe: Client Universall App WebApi Pin
Paolo Mazzon2-Nov-15 19:52
memberPaolo Mazzon2-Nov-15 19:52 
QuestionUse CreatePrintAsyncNotifyChannel to communicate from Server Port to Client Driver Pin
Member 118933017-Aug-15 4:03
memberMember 118933017-Aug-15 4:03 
QuestionWindows 8.1 Event log problem Pin
zeki yugnak24-Jun-15 4:32
memberzeki yugnak24-Jun-15 4:32 
AnswerRe: Windows 8.1 Event log problem Pin
Nitzan Levi22-Aug-15 23:11
memberNitzan Levi22-Aug-15 23:11 
GeneralRe: Windows 8.1 Event log problem Pin
Richard Andrew x6412-Nov-15 4:11
professionalRichard Andrew x6412-Nov-15 4:11 
GeneralRe: Windows 8.1 Event log problem Pin
Nitzan Levi12-Nov-15 8:51
memberNitzan Levi12-Nov-15 8:51 
QuestionTerminal: Schedule a program with main method arguments Pin
Mc_Topaz26-May-15 5:39
memberMc_Topaz26-May-15 5:39 
AnswerRe: Terminal: Schedule a program with main method arguments Pin
Richard Andrew x6426-May-15 6:35
professionalRichard Andrew x6426-May-15 6:35 
GeneralRe: Terminal: Schedule a program with main method arguments Pin
Mc_Topaz26-May-15 9:11
memberMc_Topaz26-May-15 9:11 
GeneralRe: Terminal: Schedule a program with main method arguments Pin
Graham Breach26-May-15 23:14
memberGraham Breach26-May-15 23:14 
GeneralRe: Terminal: Schedule a program with main method arguments Pin
Mc_Topaz26-May-15 23:51
memberMc_Topaz26-May-15 23:51 
QuestionEasyhook error:STATUS_INVALID_PARAMETER_4:The given 32-Bit library does not exist!<Code: 2> Pin
Member 1159616813-May-15 18:10
memberMember 1159616813-May-15 18:10 
AnswerRe: Easyhook error:STATUS_INVALID_PARAMETER_4:The given 32-Bit library does not exist!<Code: 2> Pin
Frankie-C14-May-15 2:41
memberFrankie-C14-May-15 2:41 
QuestionMultiple Client Support Server Application designed with Windows Named Pipes hangs frequently Pin
SRIVATHSAN VIJAYA21-Apr-15 0:17
memberSRIVATHSAN VIJAYA21-Apr-15 0:17 
AnswerRe: Multiple Client Support Server Application designed with Windows Named Pipes hangs frequently Pin
Richard MacCutchan21-Apr-15 0:32
protectorRichard MacCutchan21-Apr-15 0:32 
AnswerRe: Multiple Client Support Server Application designed with Windows Named Pipes hangs frequently Pin
Frankie-C24-Apr-15 6:32
memberFrankie-C24-Apr-15 6:32 

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.


Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.181114.1 | Last Updated 10 Feb 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid