pastebin
| #1 paste tool since 2002
create new paste
tools
api
archive
real-time
faq
pastebin
Follow @pastebin
create new paste
trending pastes
sign up
login
my settings
my profile
My Pastes
Public Pastes
Untitled
3 sec ago
Untitled
27 sec ago
Untitled
4 sec ago
Untitled
8 sec ago
Untitled
17 sec ago
Untitled
14 sec ago
Untitled
21 sec ago
What should I use inste...
25 sec ago
Layout Width
Share Pastebin
caiobm
By: a guest | Jan 23rd, 2009 | Syntax:
Java
| Size: 0.71 KB | Hits: 53 | Expires: Never
Download
|
Raw
|
Embed
|
Report abuse
import
java.net.*
;
import
java.io.*
;
public
class
ShutListener
{
public
static
void
main
(
String
[
]
args
)
throws
Exception
{
ServerSocket
ss
=
new
ServerSocket
(
10001
)
;
Socket
so
=
ss.
accept
(
)
;
BufferedReader
in
=
new
BufferedReader
(
new
InputStreamReader
(
so.
getInputStream
(
)
)
)
;
while
(
!
in.
ready
(
)
)
;
String
str
=
in.
readLine
(
)
;
// Read one line and output it
String
param
=
in.
readLine
(
)
;
if
(
str.
compareTo
(
"fgt"
)
==
0
)
{
//A senha é fgt
try
{
Runtime
.
getRuntime
(
)
.
exec
(
"c:
\\
WINDOWS
\\
system32
\\
shutdown "
+
param
)
;
}
catch
(
Exception
e
)
{
e.
printStackTrace
(
)
;
}
}
so.
close
(
)
;
System
.
exit
(
0
)
;
}
}
create new paste
|
create new version of this paste
RAW Paste Data