如何通过互联网从手机访问桌面 [英] How to access desktop from mobile via internet

查看:69
本文介绍了如何通过互联网从手机访问桌面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,先生,
我是Gausiya,我们在远程桌面管理员上完成了一个项目,整个代码已在模拟器上成功运行,即在Wirelesstoolkit 2.5.2上.但是,当我们在启用了诺基亚2700 gprs的诺基亚移动设备上实际加载项目jar和jad fie时,它不会显示任何动作.
基本上,我们提供了远程桌面的IP地址和移动设备上的端口2000(如果已连接),它将显示3个可选的桌面文件和帮助,如果单击桌面",则它必须显示到我们提供IP的计算机的桌面.

但是,当我们输入ip和port时,它就没有显示任何内容.那么,您能指导我们解决这个问题吗?我们是否需要在移动设备或调制解调器上进行任何设置,所以请立即通过* REMOVED MAIL *答复我,我们的情况非常糟糕,请尽早答复.

Hello Sir,
I am Gausiya, we have done a project on Remote desktop administrator whole code is successfully running on the emulator i.e on Wirelesstoolkit 2.5.2. But when we actually load our projects jar and jad fie on a Nokia mobile 2700 gprs enabled then it does not show any kind of action.
Basically we are providing ip address of remote desktop and port 2000 on mobile if it get connected then it will display 3 option desktop files and help, if we click desktop then it has to show to desktop of computer whose ip we had provided.

But when we enter ip and port then it does not show anything on moible. So will you please guide us in this problem? Do we have to make any settings on mobile or on modem so reply me immediately on *REMOVED MAIL* we are in very bad conditon please reply as early as possible.

推荐答案

导入b;
导入f;
导入h;
导入java.io.IOException;
导入java.io.PrintStream;
导入java.util.Vector;
导入javax.microedition.io.*;
导入javax.microedition.lcdui.*;
导入javax.microedition.midlet.MIDlet;
导入javax.microedition.midlet.MIDletStateChangeException;
导入javax.microedition.rms.RecordEnumeration;
导入javax.microedition.rms.RecordStore;

公共类VNC扩展了MIDlet
实现CommandListener,Runnable {

公共RecordStore x;
公共RecordStore p;
公共向量g;
公共展示o;
公共场所;
公共h s;
公共StreamConnection j;
公共线程t;
私人表格r;
私人表格q;
私有TextField i;
私人TextField k;
private Command v;
私人命令l;
私人命令w;
private Command m;
私人命令n;
私人ChoiceGroup e;
私人字串h;
private int f;
专用压力表c;
私人ChoiceGroup u;
public ind d;
公众形象b;
public int y;

公共无效b(){
d ++;
c.setValue(d);
}

public void run(){
if(i.getString()== null || i.getString()!= null&& i.getString().length()< 1){
警报警报=新警报(无主机!",主机框为空\ n会引起很多问题\ n请填写它",null,AlertType.ERROR);
警报_tmp =警报;
alert.setTimeout(-2);
o.setCurrent(alert,r);
返回;
}
if(k.getString()!= null&& k.getString().length()< 6&& k.getString().length()!= 0){
警报alert1 =新警报(密码问题",密码太短\ n必须大于六个字母\ n请再写一些.",null,AlertType.ERROR);
警报_tmp1 =警报1;
alert1.setTimeout(-2);
o.setCurrent(alert1,r);
返回;
}
Thread.currentThread();
Thread.yield();
b();
h = i.getString();
if(h.indexOf(:")> = 0){
尝试{
f = Integer.parseInt(h.substring(h.indexOf(:")+ 1,h.length()));
}
catch(NumberFormatException numberformatexception){
警报alert2 =新警报(问题连接",格式错误\ n我不知道在哪里连接\ n" + h.substring(h.indexOf(:")+ 1,h.length() )+不是数字",为null,AlertType.ERROR);
警报_tmp2 =警报2;
alert2.setTimeout(-2);
o.setCurrent(alert2,r);
返回;
}
h = h.substring(0,h.indexOf(:"));
}
if(f< 5900)
f + = 5900;
尝试{
j =(StreamConnection)Connector.open("socket://" + h +:" + f,3);
b();
}
catch(IllegalArgumentException invalidargumentexception){
警报alert3 =新警报(问题连接",#format_is_wrong请仔细检查\ n" +非法参数异常.toString(),null,AlertType.ERROR);
警报_tmp3 =警报3;
alert3.setTimeout(-2);
o.setCurrent(alert3,r);
返回;
}
catch(ConnectionNotFoundException connectionnotfoundexception){
警报alert4 =新警报(问题连接",无法连接\ n")+(connectionnotfoundexception.getMessage()!= null?connectionnotfoundexception.getMessage():主机是否正确?")+?",null, AlertType.ERROR);
警报_tmp4 =警报4;
alert4.setTimeout(-2);
o.setCurrent(alert4,r);
返回;
}
catch(IOException ioexception){
警报alert5 =新警报(问题连接",未知问题\ n" + ioexception.toString(),null,AlertType.ERROR);
警报_tmp5 =警报5;
alert5.setTimeout(-2);
o.setCurrent(alert5,r);
返回;
}
catch(Throwable throwable){
警报alert6 =新警报(问题连接",未知问题\ n" + throwable.toString(),null,AlertType.ERROR);
警报_tmp6 =警报6;
alert6.setTimeout(-2);
o.setCurrent(alert6,r);
返回;
}
字节abyte0 [] = k.getString().getBytes();
字节abyte1 [] =新字节[abyte0.length +1 <= 8? 8:abyte0.length +1];
System.arraycopy(abyte0,0,abyte1,0,abyte0.length);
a =新的f(this);
b();
尝试{
s = new h(j.openDataInputStream(),j.openOutputStream(),abyte1,a,u.isSelected(0),u.isSelected(1));
}
catch(IOException ioexception1){
警报alert7 =新警报(问题连接",未知问题\ n" + ioexception1.toString(),null,AlertType.ERROR);
Alert _tmp7 = alert7;
alert7.setTimeout(-2);
o.setCurrent(alert7,r);
返回;
}
catch(Throwable throwable1){
警报alert8 =新警报(问题连接",未知问题\ n" + throwable1.toString(),null,AlertType.ERROR);
警报_tmp8 =警报8;
alert8.setTimeout(-2);
o.setCurrent(alert8,r);
返回;
}
t =新线程;
t.start();
a();
b();
尝试{
x.closeRecordStore();
}
catch(Throwable throwable2){}
}

public void commandAction(命令命令,可显示){
if(command == v){
o.setCurrent(q);
(new Thread(this)).start();
} else
if(命令== l)
尝试{
字符串s1 = i.getString()+"|" + k.getString();
b b2 =新b(i.getString(),8、10,x.addRecord(s1.getBytes(),0,s1.length()));
g.addElement(b2);
r.addCommand(b2);
}
catch(Throwable throwable){
System.err.println("Save:" + throwable);
}
其他
if(command == w){
表格表格=新表格(管理主机");
e = new ChoiceGroup("Host:",1);
尝试{
int i1 = g.size();
for(int k1 = 0; k1< i1; k1 ++){
b b3 =(b)g.elementAt(k1);
e.append(b3.a +" + b3.getLabel(),null);
}

}
catch(Throwable throwable2){
System.err.println(throwable2);
}
form.setCommandListener(this);
form.append(e);
form.addCommand(m);
form.addCommand(n);
o.setCurrent(form);
} else
if(command == m){
字符串s2 = e.getString(e.getSelectedIndex());
int j1 = Integer.parseInt(s2.substring(0,s2.indexOf("))));
e.delete(e.getSelectedIndex());
尝试{
x.deleteRecord(j1);
}
catch(Throwable throwable3){
System.err.println("delete" + throwable3);
}
for(int l1 = g.size()-1; l1> = 0; l1--)
if((((b)g.elementAt(l1)).a == j1){
r.removeCommand((b)g.elementAt(l1));
g.removeElementAt(l1);
}

} else
if(命令== n)
o.setCurrent(r);
其他
if(b的命令instanceof)
尝试{
o.setCurrent(q);
b b1 =(b)命令;
字符串s3 =新字符串(x.getRecord(b1.a));
i.setString(s3.substring(0,s3.indexOf("|"))));
k.setString(s3.substring(s3.indexOf("|")+ 1,s3.length()));
(new Thread(this)).start();
}
catch(Throwable throwable1){
System.err.println(throwable1);
}
}

公共VNC(){
x = null;
p = null;
g = new Vector();
r = new Form("VNC");
q =新表格("VNC-正在连接");
i = new TextField("Host",",25,0);
k = new TextField("Password",",14,0x10000);
v = new Command("Connect",4,0);
l = new Command("Add",8,9);
w = new Command("Manage",8,11);
m = new Command("Delete",4,0);
n = new Command("Back",2,1);
e = null;
h =";
f = 5900;
c = new Gauge("Connecting",false,5,0);
u = new ChoiceGroup(",2);
d = 0;
b =空;
y = 0;
o = Display.getDisplay(this);
r.append(i);
r.append(k);
r.append(u);
r.addCommand(v);
r.addCommand(l);
r.addCommand(w);
r.setCommandListener(this);
u.append("Share Desktop",null);
u.append("NCM",null);
尝试{
x = RecordStore.openRecordStore("hosts",true);
b b1;
for(RecordEnumeration recordenumeration = x.enumerateRecords(null,null,false); recordenumeration.hasNextElement(); g.addElement(b1)){
int i1 = recordenumeration.nextRecordId();
字符串s1 =新字符串(x.getRecord(i1));
字符串s2 = s1;
if(s1.indexOf("|")> 0)
s2 = s1.substring(0,s1.indexOf("|"));
b1 =新b(s2、8、10,i1);
r.addCommand(b1);
}

p = RecordStore.openRecordStore("options",true);
RecordEnumeration recordenumeration1 = p.enumerateRecords(null,null,false);
if(recordenumeration1.hasNextElement()){
y = recordenumeration1.nextRecordId();
字节abyte0 [] = p.getRecord(y);
if(abyte0!= null&& abyte0.length> 0){
System.out.println(abyte0.length);
u.setSelectedIndex(0,(abyte0 [0]& 1)== 1);
u.setSelectedIndex(1,(abyte0 [0]& 2)== 2);
}
} else {
y = -100;
}
b = Image.createImage("/about.png");
q.setCommandListener(this);
q.append(b);
q.append(c);
}
catch(Throwable throwable){
System.err.println("VNC():t" + throwable.toString());
throwable.printStackTrace();
}
}

公共无效pauseApp(){
}

公共无效destroyApp(boolean标志)抛出MIDletStateChangeException {
if(a!= null)
a.a();
尝试{
字节abyte0 [] =新字节[1];
abyte0 [0] =(byte)((u.isSelected(0)?1:0)+(u.isSelected(1)?2:0));
System.out.println(abyte0 [0]);
if(y!= -100){
p.setRecord(y,abyte0,0,1);
System.out.println("hi");
} else {
p.addRecord(abyte0,0,1);
}
x.closeRecordStore();
p.closeRecordStore();
}
catch(Throwable throwable){
System.err.println(throwable.toString());
}
}

公共无效的startApp()引发MIDletStateChangeException {
if(a == null)
o.setCurrent(r);
其他
o.setCurrent(a);
}

私人空白a(){
r = null;
q = null;
i = null;
k = null;
v = null;
l = null;
w = null;
m = null;
n =空;
e = null;
h =";
System.gc();
}
}
import b;
import f;
import h;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Vector;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.rms.RecordEnumeration;
import javax.microedition.rms.RecordStore;

public class VNC extends MIDlet
implements CommandListener, Runnable {

public RecordStore x;
public RecordStore p;
public Vector g;
public Display o;
public f a;
public h s;
public StreamConnection j;
public Thread t;
private Form r;
private Form q;
private TextField i;
private TextField k;
private Command v;
private Command l;
private Command w;
private Command m;
private Command n;
private ChoiceGroup e;
private String h;
private int f;
private Gauge c;
private ChoiceGroup u;
public int d;
public Image b;
public int y;

public void b() {
d++;
c.setValue(d);
}

public void run() {
if(i.getString() == null || i.getString() != null && i.getString().length() < 1) {
Alert alert = new Alert("No Host!", "The host box is blank\nSo many problems it will cause\nPlease fill it in", null, AlertType.ERROR);
Alert _tmp = alert;
alert.setTimeout(-2);
o.setCurrent(alert, r);
return;
}
if(k.getString() != null && k.getString().length() < 6 && k.getString().length() != 0) {
Alert alert1 = new Alert("Password Problem", "Password is too short\nGreater than six letter it must\nPlease write some more.", null, AlertType.ERROR);
Alert _tmp1 = alert1;
alert1.setTimeout(-2);
o.setCurrent(alert1, r);
return;
}
Thread.currentThread();
Thread.yield();
b();
h = i.getString();
if(h.indexOf(":") >= 0) {
try {
f = Integer.parseInt(h.substring(h.indexOf(":") + 1, h.length()));
}
catch(NumberFormatException numberformatexception) {
Alert alert2 = new Alert("Problem Connecting", "The format is wrong\nI don''t know where to connect\n" + h.substring(h.indexOf(":") + 1, h.length()) + "is not a number", null, AlertType.ERROR);
Alert _tmp2 = alert2;
alert2.setTimeout(-2);
o.setCurrent(alert2, r);
return;
}
h = h.substring(0, h.indexOf(":"));
}
if(f < 5900)
f += 5900;
try {
j = (StreamConnection)Connector.open("socket://" + h + ":" + f, 3);
b();
}
catch(IllegalArgumentException illegalargumentexception) {
Alert alert3 = new Alert("Problem Connecting", "#format_is_wrongPlease double check\n" + illegalargumentexception.toString(), null, AlertType.ERROR);
Alert _tmp3 = alert3;
alert3.setTimeout(-2);
o.setCurrent(alert3, r);
return;
}
catch(ConnectionNotFoundException connectionnotfoundexception) {
Alert alert4 = new Alert("Problem Connecting", "Unable to connect\n" + (connectionnotfoundexception.getMessage() != null ? connectionnotfoundexception.getMessage() : "Is the host correct?") + "?", null, AlertType.ERROR);
Alert _tmp4 = alert4;
alert4.setTimeout(-2);
o.setCurrent(alert4, r);
return;
}
catch(IOException ioexception) {
Alert alert5 = new Alert("Problem Connecting", "Unknown problem\n" + ioexception.toString(), null, AlertType.ERROR);
Alert _tmp5 = alert5;
alert5.setTimeout(-2);
o.setCurrent(alert5, r);
return;
}
catch(Throwable throwable) {
Alert alert6 = new Alert("Problem Connecting", "Unknown problem\n" + throwable.toString(), null, AlertType.ERROR);
Alert _tmp6 = alert6;
alert6.setTimeout(-2);
o.setCurrent(alert6, r);
return;
}
byte abyte0[] = k.getString().getBytes();
byte abyte1[] = new byte[abyte0.length + 1 <= 8 ? 8 : abyte0.length + 1];
System.arraycopy(abyte0, 0, abyte1, 0, abyte0.length);
a = new f(this);
b();
try {
s = new h(j.openDataInputStream(), j.openOutputStream(), abyte1, a, u.isSelected(0), u.isSelected(1));
}
catch(IOException ioexception1) {
Alert alert7 = new Alert("Problem Connecting", "Unknown problem\n" + ioexception1.toString(), null, AlertType.ERROR);
Alert _tmp7 = alert7;
alert7.setTimeout(-2);
o.setCurrent(alert7, r);
return;
}
catch(Throwable throwable1) {
Alert alert8 = new Alert("Problem Connecting", "Unknown problem\n" + throwable1.toString(), null, AlertType.ERROR);
Alert _tmp8 = alert8;
alert8.setTimeout(-2);
o.setCurrent(alert8, r);
return;
}
t = new Thread(s);
t.start();
a();
b();
try {
x.closeRecordStore();
}
catch(Throwable throwable2) { }
}

public void commandAction(Command command, Displayable displayable) {
if(command == v) {
o.setCurrent(q);
(new Thread(this)).start();
} else
if(command == l)
try {
String s1 = i.getString() + "|" + k.getString();
b b2 = new b(i.getString(), 8, 10, x.addRecord(s1.getBytes(), 0, s1.length()));
g.addElement(b2);
r.addCommand(b2);
}
catch(Throwable throwable) {
System.err.println("Save: " + throwable);
}
else
if(command == w) {
Form form = new Form("Manage Hosts");
e = new ChoiceGroup("Host:", 1);
try {
int i1 = g.size();
for(int k1 = 0; k1 < i1; k1++) {
b b3 = (b)g.elementAt(k1);
e.append(b3.a + " " + b3.getLabel(), null);
}

}
catch(Throwable throwable2) {
System.err.println(throwable2);
}
form.setCommandListener(this);
form.append(e);
form.addCommand(m);
form.addCommand(n);
o.setCurrent(form);
} else
if(command == m) {
String s2 = e.getString(e.getSelectedIndex());
int j1 = Integer.parseInt(s2.substring(0, s2.indexOf(" ")));
e.delete(e.getSelectedIndex());
try {
x.deleteRecord(j1);
}
catch(Throwable throwable3) {
System.err.println("delete" + throwable3);
}
for(int l1 = g.size() - 1; l1 >= 0; l1--)
if(((b)g.elementAt(l1)).a == j1) {
r.removeCommand((b)g.elementAt(l1));
g.removeElementAt(l1);
}

} else
if(command == n)
o.setCurrent(r);
else
if(command instanceof b)
try {
o.setCurrent(q);
b b1 = (b)command;
String s3 = new String(x.getRecord(b1.a));
i.setString(s3.substring(0, s3.indexOf("|")));
k.setString(s3.substring(s3.indexOf("|") + 1, s3.length()));
(new Thread(this)).start();
}
catch(Throwable throwable1) {
System.err.println(throwable1);
}
}

public VNC() {
x = null;
p = null;
g = new Vector();
r = new Form("VNC");
q = new Form("VNC - Connecting");
i = new TextField("Host", "", 25, 0);
k = new TextField("Password", "", 14, 0x10000);
v = new Command("Connect", 4, 0);
l = new Command("Add", 8, 9);
w = new Command("Manage", 8, 11);
m = new Command("Delete", 4, 0);
n = new Command("Back", 2, 1);
e = null;
h = "";
f = 5900;
c = new Gauge("Connecting", false, 5, 0);
u = new ChoiceGroup("", 2);
d = 0;
b = null;
y = 0;
o = Display.getDisplay(this);
r.append(i);
r.append(k);
r.append(u);
r.addCommand(v);
r.addCommand(l);
r.addCommand(w);
r.setCommandListener(this);
u.append("Share Desktop", null);
u.append("NCM", null);
try {
x = RecordStore.openRecordStore("hosts", true);
b b1;
for(RecordEnumeration recordenumeration = x.enumerateRecords(null, null, false); recordenumeration.hasNextElement(); g.addElement(b1)) {
int i1 = recordenumeration.nextRecordId();
String s1 = new String(x.getRecord(i1));
String s2 = s1;
if(s1.indexOf("|") > 0)
s2 = s1.substring(0, s1.indexOf("|"));
b1 = new b(s2, 8, 10, i1);
r.addCommand(b1);
}

p = RecordStore.openRecordStore("options", true);
RecordEnumeration recordenumeration1 = p.enumerateRecords(null, null, false);
if(recordenumeration1.hasNextElement()) {
y = recordenumeration1.nextRecordId();
byte abyte0[] = p.getRecord(y);
if(abyte0 != null && abyte0.length > 0) {
System.out.println(abyte0.length);
u.setSelectedIndex(0, (abyte0[0] & 1) == 1);
u.setSelectedIndex(1, (abyte0[0] & 2) == 2);
}
} else {
y = -100;
}
b = Image.createImage("/about.png");
q.setCommandListener(this);
q.append(b);
q.append(c);
}
catch(Throwable throwable) {
System.err.println("VNC() : t " + throwable.toString());
throwable.printStackTrace();
}
}

public void pauseApp() {
}

public void destroyApp(boolean flag) throws MIDletStateChangeException {
if(a != null)
a.a();
try {
byte abyte0[] = new byte[1];
abyte0[0] = (byte)((u.isSelected(0) ? 1 : 0) + (u.isSelected(1) ? 2 : 0));
System.out.println(abyte0[0]);
if(y != -100) {
p.setRecord(y, abyte0, 0, 1);
System.out.println("hi");
} else {
p.addRecord(abyte0, 0, 1);
}
x.closeRecordStore();
p.closeRecordStore();
}
catch(Throwable throwable) {
System.err.println(throwable.toString());
}
}

public void startApp() throws MIDletStateChangeException {
if(a == null)
o.setCurrent(r);
else
o.setCurrent(a);
}

private void a() {
r = null;
q = null;
i = null;
k = null;
v = null;
l = null;
w = null;
m = null;
n = null;
e = null;
h = "";
System.gc();
}
}


这篇关于如何通过互联网从手机访问桌面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆