Click here to Skip to main content
13,625,905 members

Windows API

 
AnswerRe: a small problem with function Pin
Graham Breach15-Mar-16 23:54
memberGraham Breach15-Mar-16 23:54 
PraiseRe: a small problem with function Pin
VISWESWARAN199816-Mar-16 9:10
professionalVISWESWARAN199816-Mar-16 9:10 
QuestionMicrosoft COM Pin
Stefan Bogdan11-Nov-15 22:35
memberStefan Bogdan11-Nov-15 22:35 
AnswerRe: Microsoft COM Pin
Richard Andrew x6412-Nov-15 3:12
professionalRichard Andrew x6412-Nov-15 3:12 
AnswerRe: Microsoft COM Pin
Eddy Vluggen12-Nov-15 3:25
professionalEddy Vluggen12-Nov-15 3:25 
AnswerRe: Microsoft COM Pin
_Kunal Chowdhury_3-Mar-16 23:01
mentor_Kunal Chowdhury_3-Mar-16 23:01 
AnswerRe: Microsoft COM Pin
Munchies_Matt6-Apr-17 1:47
memberMunchies_Matt6-Apr-17 1:47 
QuestionClient Universall App WebApi Pin
Paolo Mazzon31-Oct-15 0:27
memberPaolo Mazzon31-Oct-15 0: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 2:17
mvpRichard Deeming2-Nov-15 2:17 
GeneralRe: Client Universall App WebApi Pin
Paolo Mazzon2-Nov-15 18:52
memberPaolo Mazzon2-Nov-15 18:52 
QuestionUse CreatePrintAsyncNotifyChannel to communicate from Server Port to Client Driver Pin
Member 118933017-Aug-15 3:03
memberMember 118933017-Aug-15 3:03 
QuestionWindows 8.1 Event log problem Pin
zeki yugnak24-Jun-15 3:32
memberzeki yugnak24-Jun-15 3:32 
AnswerRe: Windows 8.1 Event log problem Pin
Nitzan Levi22-Aug-15 22:11
memberNitzan Levi22-Aug-15 22:11 
GeneralRe: Windows 8.1 Event log problem Pin
Richard Andrew x6412-Nov-15 3:11
professionalRichard Andrew x6412-Nov-15 3:11 
GeneralRe: Windows 8.1 Event log problem Pin
Nitzan Levi12-Nov-15 7:51
memberNitzan Levi12-Nov-15 7:51 
QuestionTerminal: Schedule a program with main method arguments Pin
Mc_Topaz26-May-15 4:39
memberMc_Topaz26-May-15 4:39 
AnswerRe: Terminal: Schedule a program with main method arguments Pin
Richard Andrew x6426-May-15 5:35
professionalRichard Andrew x6426-May-15 5:35 
GeneralRe: Terminal: Schedule a program with main method arguments Pin
Mc_Topaz26-May-15 8:11
memberMc_Topaz26-May-15 8:11 
GeneralRe: Terminal: Schedule a program with main method arguments Pin
Graham Breach26-May-15 22:14
memberGraham Breach26-May-15 22:14 
GeneralRe: Terminal: Schedule a program with main method arguments Pin
Mc_Topaz26-May-15 22:51
memberMc_Topaz26-May-15 22:51 
QuestionEasyhook error:STATUS_INVALID_PARAMETER_4:The given 32-Bit library does not exist!<Code: 2> Pin
Member 1159616813-May-15 17:10
memberMember 1159616813-May-15 17:10 
AnswerRe: Easyhook error:STATUS_INVALID_PARAMETER_4:The given 32-Bit library does not exist!<Code: 2> Pin
Frankie-C14-May-15 1:41
memberFrankie-C14-May-15 1:41 
QuestionMultiple Client Support Server Application designed with Windows Named Pipes hangs frequently Pin
SRIVATHSAN VIJAYA20-Apr-15 23:17
memberSRIVATHSAN VIJAYA20-Apr-15 23:17 
AnswerRe: Multiple Client Support Server Application designed with Windows Named Pipes hangs frequently Pin
Richard MacCutchan20-Apr-15 23:32
protectorRichard MacCutchan20-Apr-15 23:32 
AnswerRe: Multiple Client Support Server Application designed with Windows Named Pipes hangs frequently Pin
Frankie-C24-Apr-15 5:32
memberFrankie-C24-Apr-15 5: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
Web02 | 2.8.180712.1 | Last Updated 10 Feb 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid