Jump to content

network chat program


buzz44
 Share

Recommended Posts

hello all, ive made this little network chat program. it finds the comps on ur network and puts there names in a list, u can then select wat comp to send ur msg to and click send... it uses the cmd function "net send", except this is more a "gui friendly" then that buts still works the same.

i have a problem :D , i got my computer on a workgroup and when i try to switch to domain i get this gay error, so i need sum1 to just run it and tell me if there comp comes up in the list, try send a msg to urself etc... plz if anyone can help out who is on a domain id much appreciate it.

heres the code

#include <Process.au3>
#include <GUIConstants.au3>

_RunDos("net view /domain" & " > " & @TempDir & "\temp.txt")

$hello = FileOpen(@TempDir & "\temp.txt", 0)

GUICreate("Network Chat", 300, 135)

$computer = GUICtrlCreateList ("", 5,40,121,97)

While 1

    $line = FileReadLine($hello)
    If @error = -1 Then ExitLoop
    GUICtrlSetData(-1,$line)

Wend

FileClose($hello)

FileDelete(@TempDir & "\temp.txt")

GUICtrlCreateLabel ("Select the computer to send your message to.",  5, 5, 150, 30)
$msg1 = GUICtrlCreateInput ("", 135,  104, 156, 20)
$send = GUICtrlCreateButton ("Send",  135, 75, 50)
GuiSetState()

While 1
    $msg = GUIGetMsg()
    if $msg = $send then
       _RunDos("net send " & GUICtrlRead($computer) & " " & GUICtrlRead($msg1))
    endif
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

just compile, thanks for help :idiot:,

Edited by burrup

qq

Link to comment
Share on other sites

I ran it and it got stuck in the first while 1 look if you want to figure out where you forgot syntax like ENDIF. and ummm, your sig needs some repair, as it [/endcommand] stuff on it, try this:

[FONT=Arial][B][COLOR=orange]The man who moved a mountain started by moving small boudlers...[/COLOR][/B][/FONT]

Which should look like this:

The man who moved a mountain started by moving small boudlers...

instead of this

The man who moved a mountain started by moving small boudlers...

Oh and why cant u just test it?

Edited by AutoIt Smith
Link to comment
Share on other sites

hey, finally someone has replied and tried it thankyou :D, for sum reason i tried it without the endif and it worked lol, but i didnt used "net view /domain" i just used "dir". the reason i cant do it is beacuse when i try "net view /domain" i get this error.

System error 6118 has occured.

The list of servers for this workgroup is currently not available.

i dont know why i get hat, but could u please open up cmd and type "net view /domain" and tell me if you get the same error plz

ty for help on the sig :idiot:

Edited by burrup

qq

Link to comment
Share on other sites

No problem on the signature, mine is pretty rad it's self. And /domain means that you are PART of a domain name. For example is autoitscript had setup a windows domain server and had it be part of the clientell network(forums) then it would be part of the domain. Since a home computer is not a domain then you will need to find a different way of transmiting you info. Maybe view packets or Larry's awesome Au3Extraz.dll My own Instant Messaging system(and everyone seems to be trying out messaging since I started) uses an advanced packet system that to this day I still can't capture anything sent by it. Perhaps you might want to use winsock or do something in C++ because as far as I can tell AutoIt doesn't support anything that has to do with cross computer text sending besides the feature of loading dll's, (with the exception of InetGet and InetGetSize).

I'm sure you can tear apart a open source im program and figure out how to do it within a router network or you can just "hire" me(not hire just ask me to do it) to make a network version of my program. It would be fairly simple, but requiring Administration setup first which I would write a documentation file for. What I would like to know is why you need to do this in the first place and what was your motivation. Well g2g play some more CS!!!!!

Peace,

AutoIt Smith

Link to comment
Share on other sites

well firstly im only 16 and still at school, our computer administrator has disabled all access to hotmail, msn, display properties, network properties etc, we cant even access c:\ drive, but we figured that we can make shorcuts to program in c drive ie. cmd, we used cmd "net send" function to send messages directly to each others pc's, much like winchat but you can send a message at anytime to any computer on the network without having to be connected with there computer ie, winchats method.. all b4 little prog is doing is getting a list of all the comps on a network putting them in a list so u can select which on 2 send it to, and letting u send ur msg, when u click the send button, it opens up a secret cmd windows (_RunDos_) and types net send $computer $msg1, where the variables have been replaced with wat u put in the input box and the computer you selected form the list, when i was at school, as i am currently in the holidays, i was figured out how to get a list of all the comps on the network, but i cant remember waT it was even thou i thnk it was net view /domain, the program will work, its just finding the right cmd "net view" function.

qq

Link to comment
Share on other sites

Hi,

first of all, "net view" lists the computers, if you choose net view /DOMAIN:, you have to submit a domainname also.

The "GUICtrlSetData" gets confused by the data in temp.txt, the list gets destroyed by the last line, imho. See the helpfile for this.

So, if you only let in the computernames, it works for my part.

#include <Process.au3>
#include <GUIConstants.au3>
_RunDOS("net view" & " > " & @TempDir & "\temp.txt")
$hello = FileOpen(@TempDir & "\temp.txt", 0)
GUICreate("Network Chat", 300, 135)
$computer = GUICtrlCreateList("", 5, 40, 121, 97)
While 1
   $line = FileReadLine($hello)
   If @error = -1 Then ExitLoop
   If StringInStr($line, "\\") Then
      GUICtrlSetData($computer, StringMid( (StringStripWS($line, 8)), 3))
   EndIf
Wend
FileClose($hello)
FileDelete(@TempDir & "\temp.txt")
GUICtrlCreateLabel("Select the computer to send your message to.", 5, 5, 150, 30)
$msg1 = GUICtrlCreateInput("", 135, 104, 156, 20)
$send = GUICtrlCreateButton("Send", 135, 75, 50)
GUISetState()
While 1
   $msg = GUIGetMsg()
   If $msg = $send Then
      _RunDOS("net send " & GUIRead($computer) & " " & GUIRead($msg1))
   EndIf
   If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

(GUICtrlRead replaced with GUIRead, you may have to put it back.

hth, Tys

Edited by Tys
Link to comment
Share on other sites

ty very much, i been waiting awhile for a reply where someone understands me lol, look great, but if i open up cmd and type 'net view" i still get the same error.

The list of servers blah blah unavailable, amybe its just the way i got comp set up :/. can u plz compile and test it if u havent already :idiot:, thanks again every one much appreciated.

qq

Link to comment
Share on other sites

ty very much, i been waiting awhile for a reply where someone understands me lol, look great, but if i open up cmd and type 'net view" i still get the same error.

The list of servers blah blah unavailable, amybe its just the way i got comp set up :/. can u plz compile and test it if u havent already :idiot:, thanks again every one much appreciated.

<{POST_SNAPBACK}>

Sound like your "computer browser" service is stopped, assuming you have Windows NT and up installed, or a firewall prevents or or or.

Maybe you better do some google searching about that error message...

But the program dous run... on my computer.... :D now...

Link to comment
Share on other sites

Sound like your "computer browser" service is stopped, assuming you have Windows NT and up installed, or a firewall prevents or or or.

Maybe you better do some google searching about that error message...

But the program dous run... on my computer....  :idiot:  now...

<{POST_SNAPBACK}>

so ur computer name comes up in the list, and ur able to send a message to yourself???

qq

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...