Board index » cppbuilder » BCB6: "code location" techniques

BCB6: "code location" techniques


2006-03-31 11:21:05 PM
cppbuilder4
Q: What could I use to determine if my application is being run from within
our company?
I've got a truly unique situation:
Our IT department set us up 2 users for our FTP account. One user has
read/write privileges and accesses our network through a local IP address
(192.168.x.x); the other user has read-only access and *must* connect
through a public IP address outside of our network.
Currently, I have included an "#if define" routine to see if _DEBUG is
defined. If it is, I assign the internal username, password and IP address;
otherwise, I use the external values.
Checking for _DEBUG works now, but it will not be good for us to test our
final product on later.
I have thought about checking for the existence of a file on my machine. If
it exists, use internal values; else, use external values. The problem with
this setup is that it would fail for the other developers here when they
tried to modify the software.
 
 

Re:BCB6: "code location" techniques

In article < XXXX@XXXXX.COM >,
"poojo hackma" <poojo.com/mail>wrote:
Quote
I have thought about checking for the existence of a file on my machine. If
it exists, use internal values; else, use external values. The problem with
this setup is that it would fail for the other developers here when they
tried to modify the software.
Could you do a call to determine the external IP address? (such as a
call to whatismyip.com) If the external address is in your company's IP
space, use the internal routing, otherwise use external routing.
--
-David
Nihil curo de ista tua stulta superstitione.
 

Re:BCB6: "code location" techniques

Unfortunately, I don't think so.
Our FTP server is located at the company headquarters and has a different
external IP address than our router at this location.
Quote
Could you do a call to determine the external IP address? (such as a
call to whatismyip.com) If the external address is in your company's IP
space, use the internal routing, otherwise use external routing.

--
-David

Nihil curo de ista tua stulta superstitione.
 

{smallsort}

Re:BCB6: "code location" techniques

poojo hackma wrote:
Quote
Q: What could I use to determine if my application is being run from within
our company?
Determine the (extern) internet IP.
Quote
I've got a truly unique situation:
That I had to read many times.
So there is a FTP server. Reachable on an intern IP and an internet IP.
There are two accounts on the server. If the server sees a client
with an internal IP it will give read/write access. If it sees an external
IP it will only give read acces. (Both need user/pass also).
Your application will be a FTP client. Your client can be used intern or extern.
Now does your client has to enforce the rules ? If so why ?
You could let the user of your application choose between the two connection
possibilities. If they dont get connected then try the other one. Your
program will remember success (in an ini file for instance) and choose that
the next time.
In the Settings .. or Options .. sections of your program the user
has the possibility to change the choice. In a TLabel somewhere the
user is informed about the connection.
Hans.
 

Re:BCB6: "code location" techniques

That might be what I have to use Hans (try one, if it doesn't work, try the
other).
The only internal use it will ever see would be when other developers are
testing it. All of our Customers would be external.
I've thought of just using a dial-up account when I'm at work to test this
software, but that seems extreme. It might be what I have to do, though.
 

Re:BCB6: "code location" techniques

poojo hackma wrote:
Quote
I've thought of just using a dial-up account when I'm at work to test this
software, but that seems extreme.
No that is not extreme. That is just what you should do.
Hans.