Feedback and/or suggestions

  • Thread starter Thread starter JoeW
  • Start date Start date
J

JoeW

I wrote a simple class to manage a ban list I have in a SQL database.
The table consists of 4 fields: ip_address, time, ban_length,
ban_type. I simply add the ip address to the database with the current
date and time, the length of the ban in minutes and the type of ban (0
= single ip, 1 = class c, 2 = class b, 3 = class a). It works fine but
I would like some feedback on it if I could get it, positive or
negative I just want an opinion or maybe some suggestions if I am
doing anything wrong. It uses a regex to match the ip address stored
in sql with the ip address from the REMOTE_ADDR header. it is here if
you want to take a look

http://www.synacksolutions.net/AccessManagment.cs.txt

Thanks for the help, you guys are great!

Joe
 
Hi Joe,
If this is heading towards being used commercially with the
possibility of added functionality then I suggest that you separate
out the database access into a separate class.
i.e. Separate the 'business' logic from the data access.
Also you may want to consider using SPROCS if database supports them.

FWIW
Bob
 
Hi Joe,
If this is heading towards being used commercially with the
possibility of added functionality then I suggest that you separate
out the database access into a separate class.
i.e. Separate the 'business' logic from the data access.
Also you may want to consider using SPROCS if database supports them.

FWIW
Bob





- Show quoted text -

Bob,

So just put all the DB connection information into a seperate class?
Could you elaborate on that a little, I understand what you mean but
maybe an example would help clarify. Thanks for the response
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top