To update DynDNS hostname from TC65i code like this needs to be used and the attached Base64.java for Base64 encoding
public String updateDynDNS()
   {
       HttpConnection c = null;
       InputStream is = null;
       OutputStream os = null;
       ByteArrayOutputStream baos = new ByteArrayOutputStream();
       String response=null;
     Â
       String url = "
http://members.dyndns.org/nic/update?system=dyndns&hostname=YOUR_HOSTNAME&wildcard=OFF";
       try {
           System.out.println("requestIPAddress(): connectie wordt geopend");
          Â
           c = (HttpConnection)Connector.open( url );                Â
           c.setRequestMethod("GET");
           c.setRequestProperty("Host","
members.dyndns.org");
           c.setRequestProperty("Authorization","Basic "+String.valueOf(Base64.encode("YOUR_USERNAME:YOUR_PASSWORD".getBytes()))+"\"");
           c.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Configuration/CLDC-1.0");          Â
          Â
          Â
          Â
           // Getting the InputStream will open the connection
           // and read the HTTP headers. They are stored until
           // requested.
           System.out.println("requestIPAddress(): response code: "+c.getResponseCode());
          Â
           is = c.openInputStream();
                    Â
                     Â
          Â
           // Get the length and process the data         Â
           System.out.println("requestIPAddress(): inputstream is ok");
           if (is != null)
           {  Â
               System.out.println("requestIPAddress(): reading inputstream");
               int ch;
               while ((ch = is.read()) != -1) {
               //System.out.print( (char)ch );
               baos.write(ch);
               }
                         Â
               response = new String(baos.toByteArray());
               //System.out.println(response);                     Â
           }
           else System.out.println("requestIPAddress(): geen inputstream verkregen");
       }
       catch ( Exception ioe )
       {
           System.out.println("Fout: "+ioe.getMessage());
           ioe.printStackTrace();          Â
       }
       finally
       {
           try
           {
               if(baos != null) {
                   baos.close();                  Â
                   //baos = null;
               }                  Â
               if (is != null) {
                   is.close();
                   //is = null;
               }              Â
               if (c != null)
               {
                   c.close();
                   //c = null;
               }
                  Â
           }
           catch (IOException ioe )
           {          Â
               System.out.println("Fout: "+ioe.getMessage());
               ioe.printStackTrace();
           }          Â
         Â
       }       Â
       return response;
   }
Kind regards,
Timo Medvedev
------------------------------
TC65i programming, source codes and training ->Â
http://www.tc65.nl