Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #10696 > unrolled thread
| Started by | Ilya Lakhmitski <ilya.lakhmitski@gmail.com> |
|---|---|
| First post | 2011-12-13 01:31 -0800 |
| Last post | 2011-12-14 02:01 -0800 |
| Articles | 12 — 7 participants |
Back to article view | Back to comp.lang.java.programmer
WORKGROUP Ilya Lakhmitski <ilya.lakhmitski@gmail.com> - 2011-12-13 01:31 -0800
Re: WORKGROUP Ilya Lakhmitski <ilya.lakhmitski@gmail.com> - 2011-12-13 02:12 -0800
Re: WORKGROUP Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-12-13 12:27 +0000
Re: WORKGROUP Ilya Lakhmitski <ilya.lakhmitski@gmail.com> - 2011-12-13 04:33 -0800
Re: WORKGROUP Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-12-13 15:01 +0000
Re: WORKGROUP Lew <lewbloch@gmail.com> - 2011-12-13 07:52 -0800
Re: WORKGROUP Steve Sobol <sjsobol@JustThe.net> - 2011-12-13 13:36 -0800
Re: WORKGROUP Roedy Green <see_website@mindprod.com.invalid> - 2011-12-13 07:40 -0800
Re: WORKGROUP Roedy Green <see_website@mindprod.com.invalid> - 2012-01-04 17:27 -0800
Re: WORKGROUP Rajiv Gupta <rajiv@invalid.com> - 2011-12-14 17:15 +1100
Re: WORKGROUP Lew <lewbloch@gmail.com> - 2011-12-13 23:46 -0800
Re: WORKGROUP Paul Cager <paul.cager@googlemail.com> - 2011-12-14 02:01 -0800
| From | Ilya Lakhmitski <ilya.lakhmitski@gmail.com> |
|---|---|
| Date | 2011-12-13 01:31 -0800 |
| Subject | WORKGROUP |
| Message-ID | <8f03213b-5a9e-40c5-b106-7f58a4398dae@t38g2000yqe.googlegroups.com> |
Is there a way to get the name of WORKGROUP in java?
[toc] | [next] | [standalone]
| From | Ilya Lakhmitski <ilya.lakhmitski@gmail.com> |
|---|---|
| Date | 2011-12-13 02:12 -0800 |
| Message-ID | <fa0b723a-d0d5-4ca7-9a67-293afca9fd47@a17g2000yqj.googlegroups.com> |
| In reply to | #10696 |
WORKGROUP - it is the network workgroup in which the computer is set.
[toc] | [prev] | [next] | [standalone]
| From | Nigel Wade <nmw-news@ion.le.ac.uk> |
|---|---|
| Date | 2011-12-13 12:27 +0000 |
| Message-ID | <9koul8Fhg9U1@mid.individual.net> |
| In reply to | #10698 |
On 13/12/11 10:12, Ilya Lakhmitski wrote: > WORKGROUP - it is the network workgroup in which the computer is set. and if the computer is not in a WORKGROUP, what would you expect to happen? To give you some kind of clue, Java is cross-platform. -- Nigel Wade
[toc] | [prev] | [next] | [standalone]
| From | Ilya Lakhmitski <ilya.lakhmitski@gmail.com> |
|---|---|
| Date | 2011-12-13 04:33 -0800 |
| Message-ID | <83baf3d8-c3b4-4b0f-8edc-5680002076e7@w3g2000vbw.googlegroups.com> |
| In reply to | #10699 |
If the computer is not in a WORKGROUP, the value can be NULL. it is ok. The question is not what happens if something will occur, but how to get the name of WORKGROUP using java for different operation systems.
[toc] | [prev] | [next] | [standalone]
| From | Nigel Wade <nmw-news@ion.le.ac.uk> |
|---|---|
| Date | 2011-12-13 15:01 +0000 |
| Message-ID | <9kp7lfFplfU1@mid.individual.net> |
| In reply to | #10700 |
On 13/12/11 12:33, Ilya Lakhmitski wrote: > If the computer is not in a WORKGROUP, the value can be NULL. it is > ok. > > The question is not what happens if something will occur, but how to > get the name of WORKGROUP using java for different operation systems. There is no concept of "WORKGROUP" in different operating systems. It is entirely a Microsoft Windows concept only. Not even all Windows machines belong to a WORKGROUP. If you are developing cross-platform software it can't be required. If it is required then the software will only work on Windows, and you need to ask yourself whether a language which has direct access to Windows-only features might be more appropriate. That is what my clue was alluding to. -- Nigel Wade
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2011-12-13 07:52 -0800 |
| Message-ID | <19360385.2860.1323791557719.JavaMail.geo-discussion-forums@prnx7> |
| In reply to | #10700 |
On Tuesday, December 13, 2011 4:33:07 AM UTC-8, Ilya Lakhmitski wrote: > If the computer is not in a WORKGROUP, the value can be NULL. it is > ok. In Java that's spelled "null". > The question is not what happens if something will occur, but how to > get the name of WORKGROUP using java [sic] for different operation systems. Of course the question is what happens when something occurs. That's what programming is - the creation of instructions to the computer to tell it what happens (well, what to make happen) when something occurs. You should go back over the answers people have given you and assimilate them. That said, there is possibly a way to obtain a system descriptor from the OS that tells the program whatever the OS happens to know about its network, but as everyone keeps telling you, what you want is highly system specific (as in, unique to a system). You would have to make a cross-platform system call, determine from the answer that you do or do not have Windows, then crack down to the level of Windows-specific information. Unfortunately for you, I do not know what such a system call would be, nor do I care to Google it for you if you aren't doing so. GIYF. I recommend that you consider carefully not, "How do I determine what WORKGROUP [sic] this node is in?" but, "What am I really trying to accomplish?" Sometimes we get tunnel vision on a particular idiom when a different approach actually would suit better. So what does having the workgroup buy you, and couldn't just knowing the IP address (which tells you what sub-LAN you're in) give you what you need (and in a cross-platform way!)? -- Lew
[toc] | [prev] | [next] | [standalone]
| From | Steve Sobol <sjsobol@JustThe.net> |
|---|---|
| Date | 2011-12-13 13:36 -0800 |
| Message-ID | <MPG.29510f3b16a3366b989890@news.justthe.net> |
| In reply to | #10699 |
In article <9koul8Fhg9U1@mid.individual.net>, Nigel Wade says... > > On 13/12/11 10:12, Ilya Lakhmitski wrote: > > WORKGROUP - it is the network workgroup in which the computer is set. > > and if the computer is not in a WORKGROUP, what would you expect to happen? > > To give you some kind of clue, Java is cross-platform. jCIFS will do what Ilya needs, either on Windows or on a Linux or OS X box running SAMBA. -- Steve Sobol - Programming/WebDev/IT Support sjsobol@JustThe.net
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2011-12-13 07:40 -0800 |
| Message-ID | <ncsee7l5gfa3466idi8r2mkuef0hc288t2@4ax.com> |
| In reply to | #10696 |
On Tue, 13 Dec 2011 01:31:40 -0800 (PST), Ilya Lakhmitski <ilya.lakhmitski@gmail.com> wrote, quoted or indirectly quoted someone who said : >Is there a way to get the name of WORKGROUP in java? Java is WORA. Workgroup is specific to Windows so you won't find anything in the official Java to find it out. You would have to use JNI or exec something to find it out. See http://mindprod.com/jgloss/jni.html http://mindprod.com/jgloss/exec.html -- Roedy Green Canadian Mind Products http://mindprod.com For me, the appeal of computer programming is that even though I am quite a klutz, I can still produce something, in a sense perfect, because the computer gives me as many chances as I please to get it right.
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2012-01-04 17:27 -0800 |
| Message-ID | <5pu9g7tsk58e1ufl7s09ob3fom2rjctqaa@4ax.com> |
| In reply to | #10703 |
On Tue, 13 Dec 2011 07:40:04 -0800, Roedy Green <see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted someone who said : >Java is WORA. Workgroup is specific to Windows so you won't find >anything in the official Java to find it out. You would have to use >JNI or exec something to find it out. See if there is anything in the C++ windows API to change the workgroup. It might be considered something too dangerous to trust to non-OS code. Scan the Google to see if anyone has a solution, then encapsulate it with an exec or JNI. see http://mindprod.com/jgloss/jni.html http://mindprod.com/jgloss/exec.html If you were willing to endure great expense and pain, you would get some sort of disassembler or trace debugger and watch C:\Windows\System32\control.exe to see what it does when you manually change the workgroup. I used to do this all the time with 16-bit code. Then the guy who wrote my disassembler died and the tracer Periscope went out of business. -- Roedy Green Canadian Mind Products http://mindprod.com If you can't remember the name of some method, consider changing it to something you can remember.
[toc] | [prev] | [next] | [standalone]
| From | Rajiv Gupta <rajiv@invalid.com> |
|---|---|
| Date | 2011-12-14 17:15 +1100 |
| Message-ID | <jc9eu5$6oi$1@speranza.aioe.org> |
| In reply to | #10696 |
On 2011-12-13 20:31:40 +1100, Ilya Lakhmitski said: > Is there a way to get the name of WORKGROUP in java? Hello there good Sir! I don't know why the people in this webstation Google group page are showing strange attitude towards you. Perhaps they think their situation and knowledge is superior and they want to make sure that you know it. Well, don't worry. Contrary to what these clowns are saying, there is a portable way to do it. Java's java.util.prefs.Preferences package provides full support for reading values from the Windows registry. You will have to consult the Microsoft documentation to get the registry key path to play with.
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2011-12-13 23:46 -0800 |
| Message-ID | <13929319.200.1323848789052.JavaMail.geo-discussion-forums@prix23> |
| In reply to | #10720 |
Rajiv Gupta wrote: > Hello there good Sir! I don't know why the people in this webstation > Google group page are showing strange attitude towards you. Perhaps I beg your pardon, but comp.lang.java.programmer is not a Google group. It is a Usenet forum. -- Lew
[toc] | [prev] | [next] | [standalone]
| From | Paul Cager <paul.cager@googlemail.com> |
|---|---|
| Date | 2011-12-14 02:01 -0800 |
| Message-ID | <7fb87d89-6c78-4035-8755-71769837bc12@o1g2000vbe.googlegroups.com> |
| In reply to | #10720 |
On Dec 14, 6:15 am, Rajiv Gupta <ra...@invalid.com> wrote: > On 2011-12-13 20:31:40 +1100, Ilya Lakhmitski said: > > > Is there a way to get the name of WORKGROUP in java? > > Java's java.util.prefs.Preferences package > provides full support for reading values from the Windows registry. > > You will have to consult the Microsoft documentation to get the > registry key path to play with. If there is an environment variable set to the workgroup name you might find it easier to read that. See http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/System.html#getenv() I don't have access to a Windows machine with a workgroup to check if there is such an environment variable, but my bet is that there will be. As other people have pointed out this is very much system-dependent - but that might not be a problem for you.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web