Jump to content

Disconnect internet

- - - - -

  • Please log in to reply
12 replies to this topic

#1
arunjib

arunjib

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
I want to develop a program which can disconnect my active internet connection. can anybody help me?

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Java is probably not the best language for this, and it will be highly OS dependent. Doing this on Windows is quite different from Mac or Linux.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
You can create a native library in C and load it in to your Java application, although as WP suggested this is not the best language to be doing this in.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#4
arunjib

arunjib

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
i want to develop the program for windows xp... how can i start my study. i want to develop only with java

WingedPanther said:

Java is probably not the best language for this, and it will be highly OS dependent. Doing this on Windows is quite different from Mac or Linux.


#5
arunjib

arunjib

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
i want to develop the program to develop my concept only. so i want to develop only with java. not with C. please help me

Alexander said:

You can create a native library in C and load it in to your Java application, although as WP suggested this is not the best language to be doing this in.


#6
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
Java runs in a virtual machine, it is simply not the language to be doing this. You can only work with the native networking if you utilize JNI (Java Native Interface) and/or load a C library.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#7
arunjib

arunjib

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
I never heared about JNI (Java Native Interface). Please tell me more about that. I want to know more about that.
As i want to develope the program only for education purpose and as i am practising JAVA only i don't want to develop it throw C.

Alexander said:

Java runs in a virtual machine, it is simply not the language to be doing this. You can only work with the native networking if you utilize JNI (Java Native Interface) and/or load a C library.


#8
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
I can tell you that you still need to write a C library to perform this.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#9
arunjib

arunjib

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
ohh! C will not leave me! ha ha....
Ok sir let me know ...

Alexander said:

I can tell you that you still need to write a C library to perform this.


#10
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
For windows you can just access the commandpromt using the Runtime class and execute "ipconfig /release" I guess :p

#11
arunjib

arunjib

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
i want to disconnect my internet connection after a certain time (e.g., 1 h 2 min 32 sec)
is that possible throw command prompt

wim DC said:

For windows you can just access the commandpromt using the Runtime class and execute "ipconfig /release" I guess :p


#12
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
Just do Thread.sleep(milliseconds) and execute runtime after it.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users