IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Windows Mobile .NET Discussion :

[VB.NET] Comment mettre à jour Date/Heure de mon PDA ?


Sujet :

Windows Mobile .NET

  1. #1
    Membre régulier
    Homme Profil pro
    Chef de projet NTIC
    Inscrit en
    Septembre 2004
    Messages
    145
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Chef de projet NTIC
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2004
    Messages : 145
    Points : 95
    Points
    95
    Par défaut [VB.NET] Comment mettre à jour Date/Heure de mon PDA ?
    Bonjour,

    je développe une application où j'ai besoin d'avoir la date de mon ppc à jour, pour ceux ce que jai fait c'est que lors de la réception des données (RDA) de mon serveur j'utilise la requette "SELECT GETDATE() AS DATE" pour récupérer la date du serveur mais je n'ai pas trouver comment utiliser celle ci pour mettre à jour celle de mon PDA.
    Est ce que quelqu'un aurait une idée? Merci

  2. #2
    Membre confirmé

    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    481
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Janvier 2006
    Messages : 481
    Points : 616
    Points
    616
    Par défaut
    Tiens j'ai trouver ca sur le net ... (Google)
    J'espere que ca t'aidera
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <ol class="decimal"><li style="">using System;</li><li style="">using System.Runtime.InteropServices;</li><li style="">namespace CSUtil</li><li style="">{</li><li style="">    /// <summary></li><li style="">    /// Summary description for TimeChange.</li><li style="">    /// </summary></li><li style="">    public class TimeChange</li><li style="">    {</li><li style="">        [StructLayout(LayoutKind.Sequential)]</li><li style="">            public struct SYSTEMTIME</li><li style="">        {</li><li style="">            public short wYear;</li><li style="">            public short wMonth;</li><li style="">            public short wDayOfWeek;</li><li style="">            public short wDay;</li><li style="">            public short wHour;</li><li style="">            public short wMinute;</li><li style="">            public short wSecond;</li><li style="">            public short wMilliseconds;</li><li style="">        }</li><li style="">        [DllImport("kernel32.dll", SetLastError=true)]</li><li style="">        private static extern bool SetSystemTime( [In] ref SYSTEMTIME st );</li><li style="">        public static void SetTime(DateTime time)</li><li style="">        {</li><li style="">            SYSTEMTIME st = new SYSTEMTIME();</li><li style="">            st.wYear = (short)time.Year;</li><li style="">            st.wMonth = (short)time.Month;</li><li style="">            st.wDay = (short)time.Day;</li><li style="">            st.wHour = (short)time.Hour;</li><li style="">            st.wMinute = (short)time.Minute;</li><li style="">            st.wSecond = (short)time.Second;</li><li style="">            st.wMilliseconds = (short)time.Millisecond;</li><li style="">            SetSystemTime(ref st);</li><li style="">        }</li><li style="">        public static void SetTime(SYSTEMTIME time)</li><li style="">        {</li><li style="">            SetSystemTime(ref time);</li><li style="">        }</li><li style="">        private TimeChange()</li><li style="">        {</li><li style="">        }</li><li style="">    }</li><li style="">}</li></ol>

  3. #3
    Membre régulier
    Homme Profil pro
    Chef de projet NTIC
    Inscrit en
    Septembre 2004
    Messages
    145
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Chef de projet NTIC
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2004
    Messages : 145
    Points : 95
    Points
    95
    Par défaut
    Citation Envoyé par notalp
    Tiens j'ai trouver ca sur le net ... (Google)
    J'espere que ca t'aidera
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <ol class="decimal"><li style="">using System;</li><li style="">using System.Runtime.InteropServices;</li><li style="">namespace CSUtil</li><li style="">{</li><li style="">    /// <summary></li><li style="">    /// Summary description for TimeChange.</li><li style="">    /// </summary></li><li style="">    public class TimeChange</li><li style="">    {</li><li style="">        [StructLayout(LayoutKind.Sequential)]</li><li style="">            public struct SYSTEMTIME</li><li style="">        {</li><li style="">            public short wYear;</li><li style="">            public short wMonth;</li><li style="">            public short wDayOfWeek;</li><li style="">            public short wDay;</li><li style="">            public short wHour;</li><li style="">            public short wMinute;</li><li style="">            public short wSecond;</li><li style="">            public short wMilliseconds;</li><li style="">        }</li><li style="">        [DllImport("kernel32.dll", SetLastError=true)]</li><li style="">        private static extern bool SetSystemTime( [In] ref SYSTEMTIME st );</li><li style="">        public static void SetTime(DateTime time)</li><li style="">        {</li><li style="">            SYSTEMTIME st = new SYSTEMTIME();</li><li style="">            st.wYear = (short)time.Year;</li><li style="">            st.wMonth = (short)time.Month;</li><li style="">            st.wDay = (short)time.Day;</li><li style="">            st.wHour = (short)time.Hour;</li><li style="">            st.wMinute = (short)time.Minute;</li><li style="">            st.wSecond = (short)time.Second;</li><li style="">            st.wMilliseconds = (short)time.Millisecond;</li><li style="">            SetSystemTime(ref st);</li><li style="">        }</li><li style="">        public static void SetTime(SYSTEMTIME time)</li><li style="">        {</li><li style="">            SetSystemTime(ref time);</li><li style="">        }</li><li style="">        private TimeChange()</li><li style="">        {</li><li style="">        }</li><li style="">    }</li><li style="">}</li></ol>
    Merci...

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 1
    Dernier message: 02/10/2010, 16h43
  2. [1.1 > 2.0]Comment mettre à jour le framework .NET ?
    Par dinbougre dans le forum Framework .NET
    Réponses: 3
    Dernier message: 11/07/2006, 11h05
  3. Réponses: 7
    Dernier message: 13/06/2006, 15h39
  4. Réponses: 2
    Dernier message: 02/05/2006, 09h50
  5. [ADO.NET][VB.NET]Comment mettre à jour BDD avec DataSet?
    Par fuhraih dans le forum Accès aux données
    Réponses: 1
    Dernier message: 17/01/2006, 16h35

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo