Jump to content
Fórum Script Brasil
  • 0

Java + phpWeb


Alan Correa

Question

Olá pessoal, estou com uma dificuldade..preciso /enviar/inserir dados de uma aplicação java desktop, para uma página web(php)..via get ou post. se for via get, precisa criptografar. Algué pode me dar uma ajuda?

segue o que já desenvolvi:

import projetofinaltiago.Id;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.net.*;
import java.io.*;
import java.awt.Desktop;
import java.net.URI; 

public class Main{

   public static void main(String[] args){

      Id id1 = new Id ();
      id1.mudaId ("7897hgf");
      id1.exibeDados ();
      Desktop d = Desktop.getDesktop();
     

    InetAddress ip;
    try {

        ip = InetAddress.getLocalHost();
        //System.out.println("Current IP address : " + ip.getHostAddress());

        NetworkInterface network = NetworkInterface.getByInetAddress(ip);

        byte[] mac = network.getHardwareAddress();

        System.out.print("Endereço MAC: ");

        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < mac.length; i++) {
            sb.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : ""));
                        
        }
        System.out.println(sb.toString());

    } catch (UnknownHostException e) {

        e.printStackTrace();

    } catch (SocketException e){

        e.printStackTrace();

    }
        try {
        Desktop.getDesktop().browse(new URI( "http://saude.administre.me/teste"));

            } catch (Exception ex) {
              ex.printStackTrace();
                               }
   }

}

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...