|
-
Sep 18th, 2003, 02:35 AM
#1
Thread Starter
New Member
hello friends....how to find the frequency of chars in a text file
hello friends.... i need help
how to count the frequency of char in a text file....
can anyone tell me or send me the code in vb.net
example
suppose in a file
aaaabbbbccccdddeeee
then i we should get the output like
not only alphabet.. but also special characters
a = 4 ,b = 4,c = 4 ,d = 3 e = 4
-
Sep 18th, 2003, 03:49 AM
#2
Lively Member
Hi,
It is easy.... assume that you are calculate the character are from ascii 1 to ascii 255.
Declare one integer array of 255 slots:
then read byte by byte, convert to ascii code and put it into the ascii code slot. Ex:
freq(asc(myChar)) +=1
Loop all then way until finish and then check the result.
-
Sep 19th, 2003, 03:35 AM
#3
Thread Starter
New Member
hi guys... thanks for the replying... i have new doubt
hello friends... may be my doubts seems to be stupid... but i really want to know...
1. how to find the system names/ip that r online in LAN
2. how do i get the list of shared drives on lan and access them.
can anyone help me out by sending code for it in vb.net or please give me detailed algorithm.
thanking you,
goutham
-
Sep 19th, 2003, 04:35 AM
#4
Lively Member
Imports system
Imports System.Net.DNS
Private Function GetIPAddress() As String
Dim oAddr As System.Net.IPAddress
Dim sAddr As String
With system.Net.DNS.GetHostByName(system.Net.DNS.GetHostName())
oAddr = New System.Net.IPAddress(.AddressList(0).Address)
sAddr = oAddr.ToString
End With
GetIPAddress = sAddr
End Function
Private Function GetName() as string
Dim shostname As String
shostname = system.Net.DNS.GetHostName
return shostname
End Function
to list the shared folder, just Dir("\\" & myHostTarget ) and filter with folder attribute.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|