How Do I find a username on a txt file or a listbox?
in Code please not Case
Which one are you tryin to find it from?
Like add a name to a ListBox from (for example) users.txt?
Quote
Public Sub FillList()
LISTBOX.Clear
s = dir$(App.Path & "\TEXT.txt")
If s = "" Then
Open (App.Path & "\TEXT.txt") For Output As #1
Close #1
End If
Open (App.Path & "\TEXT.txt") For Input As #1
On Error Resume Next
Do
Input #1, z
LISTBOX.AddItem (z)
Loop Until EOF(1)
Close #1
end sub
umm i know how to load from to and from a listbox
I dont really need that i wanna know how to find something in a txt file like a shitlist, if someone joins the channel and they're on it ban them...
Quote from: TriCk on May 24, 2003, 06:43 PM
umm i know how to load from to and from a listbox
I dont really need that i wanna know how to find something in a txt file like a shitlist, if someone joins the channel and they're on it ban them...
Setting aside that loading from a text file to test for bannables is a bad idea for efficiency reasons:
int fd = open ("banlist.txt", O_RDONLY);
/* InFile(int fd, const char *sz) checks to see if any entry in the newline delimited file attached to fd matches the string in sz. Matches are literal. Use InFile_Wild() for wildcard matching.
*/
if (InFile (fd, szJoiningUser))
queuetxt ("/ban %s Autoban", szJoiningUser);
close (fd);Required headers: fcntl.h, stdio.h (iirc); see the manpage for open(2) to confirm. Remember to close the descriptor afterward with close(2), or your program will leak descriptors.
is that vb ?
in vb please :-\
thanx anyway ______
np
are you tring to find a user in your database?
or tring to load the user into the database from a text file?
Either find the user in a listbox
Or
Find them in Users.txt
Ive got the listbox loading and saving Users.txt
to add some and shit
but i dunno how to safelist all of em...
either make a diffrent listbox and name it safelist check to see if there on the list if there on the list dont ban them else ban them.
or another possiblility is make a listview and give the user the tag of "S". When the user joins the channel check the tag. if the Tag is "S" then dont ban them else Ban them. hope this helps some.