Results 1 to 5 of 5
  1. #1
    jayeth's Avatar
    jayeth is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Question how to run chat application on multiple systems

    Hi guys,
    I have a pure java chat application that I want to run it on multiple system ie., in one server and multiple client machine...i tried running in a single system(first computer) having it as both the server and the client, it worked...
    when i tried to run this on 2nd computer through the ip address of the first computer ie., without moving the files to 2nd computer, the program didn't run.
    (i'm using the batch file to run the java program)

    ...the command prompt says
    "Cmd.exe does not support UNC names as the current directory"
    How do i solve this?

  2. #2
    tomer1960 is offline Member
    Join Date
    Mar 2009
    Posts
    9
    Rep Power
    0

    Default

    Hi

    I do not familiar with this problem, but try

    support.microsoft.com/kb/156276

  3. #3
    jayeth's Avatar
    jayeth is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Default

    Thought so...but is there a better solution for this?...cos u know, it's not practically possible for me to change the registry of all the computers in the intranet...i guess these r the problems i got go with if i had to use java ...Do u think i should rather convert it to JSP? :confused:

  4. #4
    tomer1960 is offline Member
    Join Date
    Mar 2009
    Posts
    9
    Rep Power
    0

    Default

    It is possible because JSP pages / Servlets are executed in the server side,
    so I belive it can be a solution.

  5. #5
    jayeth's Avatar
    jayeth is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Unhappy

    this code works fine for reading from registry and displaying the location of the favorite folder...i want this program to write to registry..i tried using changing the value of REQUERY_UTIL to add reg...but that didn't work...can u help me?
    Java Code:
    import java.io.*;
    import java.lang.*;
        
    public class RegQuery {   
        
    private static final String REGQUERY_UTIL = "reg add ";   
    private static final String REGSTR_TOKEN = "REG_DWORD";   
    private static final String COMPUTER_WINDOWS_FAVORITES_FOLDER = REGQUERY_UTIL +   
    "\"HKCU\\Software\\Microsoft\\Command Processor\" /v DisableUNCCheck /t REG_DWORD /d 000000001 /f";   
        
    public static String getCurrentPCFavorites()   
    {   
    try {   
    Process process = Runtime.getRuntime().exec(COMPUTER_WINDOWS_FAVORITES_FOLDER);   
    StreamReader reader = new StreamReader(process.getInputStream());   
    reader.start();   
    process.waitFor();   
    reader.join();   
    String result = reader.getResult();   
    int p = result.indexOf(REGSTR_TOKEN);   
    if (p == -1)   
    return null;   
    return result.substring(p + REGSTR_TOKEN.length()).trim();   
    }   
    catch (Exception e) {   
    String s="error";
    return s;
    }   
    }   
        
    static class StreamReader extends Thread {   
    private InputStream is;   
    private StringWriter sw;   
        
    StreamReader(InputStream is) {   
    this.is = is;   
    sw = new StringWriter();   
    }   
        
    public void run() {   
    try {   
    int c;   
    while ((c = is.read()) != -1)   
    sw.write(c);   
    }   
    catch (IOException e) { ; }   
    }   
        
    String getResult() {   
    return sw.toString();   
    }   
    }   
        
    public static void main(String s[]) {   
    System.out.println("Personal directory : " + getCurrentPCFavorites());   
    }   
    }

Similar Threads

  1. How to implement private chat application using jsp
    By PortalTeam in forum JavaServer Pages (JSP) and JSTL
    Replies: 9
    Last Post: 02-19-2010, 10:49 PM
  2. Multiple views on user interface application
    By dand_dd in forum SWT / JFace
    Replies: 36
    Last Post: 04-24-2009, 09:05 AM
  3. [SOLVED] Chat Application question
    By ChrisMayhew in forum New To Java
    Replies: 5
    Last Post: 01-09-2009, 08:44 PM
  4. Replies: 1
    Last Post: 11-23-2008, 02:21 AM
  5. Help in Chat application
    By zocky in forum Networking
    Replies: 0
    Last Post: 11-08-2007, 07:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •