[THIN] Re: Need a little Kix help !

  • From: "Braebaum, Neil" <Neil.Braebaum@xxxxxxxxxxxxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Wed, 10 Sep 2003 14:03:35 +0100

Do you really want to run the command, then redirect to a file, then
have to open and read (and then subsequently parse) the file?
 
I'm not sure you could easily get the standard output from a command you
run from inside a Kix script (in this case, clientip.exe), but what you
could do is use the for command (from a command file) and use that to
pass it to Kix as a variable - then work on the variable inside the
script. As an aside, you could almost certainly do all this merely with
commands in cmd files, as opposed to necessarily needing Kix to process
it.
 
But on the assumption that you need the use of Kix for other things not
easily done with just cmd files, if you do need to read a file in Kix,
you simply use the open function, readline function (you'd loop, here,
and check the return value to see if you've reached the end of the file)
then finally the close function - as you'd do similarly in other
scripting and programming languages.
 
Once you've got the IP address in a variable, you could use the split
function (as presumably you cannot always guarantee that each element of
the address is going to be 3 numerics), then either group the first two
elements and use the select case endselect construct (depending on
number of differing cases) or if conditions.
 
You'll need to print off the Kixtart document to fully understand the
syntax of the Kixtart functions - but this should be a relatively
trivial task once you've got the syntax in front of you.
 
Neil

        -----Original Message-----
        From: Daniel Schoppmann [mailto:dschoppmann@xxxxxx] 
        Sent: 10 September 2003 13:21
        To: thin@xxxxxxxxxxxxx
        Subject: [THIN] Need a little Kix help !
        
        

         Hi list

        I found clientip.exe just to be the right tool to get the true
Clients IP.

        Now I am using KIX, I want to decide wether a user comes from
outside or not.

        For inside, we have a Class B-Network with non private adresses.
(149.249.*)

        How can I teach KIX to take the output of the little
clientip.exe-Programm, put it in a variable and compare it with an if
else "consists" Request ?

        e.g. if var_clientip consists "149.249." goto outside-access 

        else goto inside-access

         

        I already tried

        Run "clientip>H:\clientip.txt" 

        to create a file on the users home-directory, from which I can
read the content then.

        Although I don't know how to read the content of a file with KIX
:-(

        I know this must be easy for somebo! dy, who is good in
KIX-Scripting.

        Hope somebody could help me.

        Thanks in advance, Daniel


***********************************************
This e-mail and its attachments are confidential
and are intended for the above named recipient
only. If this has come to you in error, please 
notify the sender immediately and delete this 
e-mail from your system.
You must take no action based on this, nor must 
you copy or disclose it or any part of its contents 
to any person or organisation.
Statements and opinions contained in this email may 
not necessarily represent those of Littlewoods.
Please note that e-mail communications may be monitored.
The registered office of Littlewoods Limited and its
subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB.
Registered number of Littlewoods Limited is 262152.
************************************************

Other related posts: