|
1) valid format -- check it "manually" though code -- i don't know if the maskedtextbox or regular expressions can put a limit on the number(<=255)within each segment.
2) valid ip -- if your using 2005 - you can ping it
3) datatype -- string
|
|
|
|
|
valid format -- check it "manually" though code
and how is that??? :S
Regards
Ramy
|
|
|
|
|
Dim sIP As String = "192.168.0.1"
Dim sa() As String = sIP.Split(".")
If sa.Length <> 4 Then
MsgBox("invalid ip")
Exit Sub
End If
For i As Int16 = 0 To sa.GetUpperBound(0)
If Not IsNumeric(sa(i)) OrElse CInt(sa(i)) > 255 OrElse CInt(sa(i)) < 0 Then
MsgBox("invalid ip")
Exit Sub
End If
Next
|
|
|
|
|
|
I am a novice so I may not be a 100% correct but try this
If Not(Textbox1.text like "###.###.###.###")then
msgbox("You have not entered a valid format.")
Else
'perform routine.
End If
This should at least ensure they are entering the proper format (not a string, or odd characters, but it will not validate the IP address.
|
|
|
|
|
Hi,
i am using fileget to read a file, but i am going the following error:
System.Security.SecurityException was unhandled
Message="Late bound calls to file system methods in the Visual Basic runtime are not permitted."
My code is the following:
Public Structure rec
<vbfixedstring(4)> Public icount As String
<vbfixedstring(48)> Public iTellerID As String
<vbfixedstring(48)> Public iTellerName
End Structure
Public myrec = New rec
Dim iFr As Short
iFr = FreeFile()
FileOpen(iFr, "day_08.log", OpenMode.Binary, OpenAccess.Read)
FileGet(iFr, myrec,1)
FileClose(iFr)
What i am doing wrong? Please help.
|
|
|
|
|
You can find examples of reading and writing binary files in VB.NET here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you for replying,
The matter is that i am trying to read a data file. The company who wrote the file sent me a sample of how to read their file but the problem is that the sample is in c++ and my app is in vb.net
the data file sounds like that:
?
‰ L $100 CB 36772579 C $100 FB 49553858 B $100 FL 01935605 A $100 FB 63796061 A $100 FB 33316613 A $100 AB 665
The sample code is:
typedef struct tag_RawDataNoImage
{
// Default Data
char iTellerID[48];
char iTellerName[48];
char iWorkstationID[16];
char iCustomerName[48];
char iCustomerACNo[32];
char iCustomerAddr1[64];
char iCustomerAddr2[64];
char iCustomerIDNo[32];
// Counter Data
SYSTEMTIME iDateTime;
int iType; // 0:Dollar , 1:Euro
int iDenom[10];
int iUnit[10]; // Number of each denomination
int iTotalUnit; // Total Number of count
int iTotalAmount; // Amount of count
int iUVMG; // 0-None , 1-UV , 2-MG , 3-UV/MG
char iImgResult[MAX_ROW_COUNT][32];
} RawData;
int main(int argc, char* argv[])
{
unsigned int i;
CFile file;
DWORD iRawDataCount;
RawData data;
CString itemStr, dataStr;
int uIndex,fOfs;
if(argc < 2)
{
printf("please enter name of Raw file. ex: Day_08.log\n");
return 0;
}
if(!file.Open(argv[1], CFile::modeReadWrite ))
{
printf("File open error!!!\n");
return 0;
}
file.Read(&iRawDataCount, sizeof(DWORD));
file.Seek(sizeof(DWORD),CFile::begin);
for(i=0;i
|
|
|
|
|
Hey Guys
Having a picutre 'geographical map'
how can i know if the user has clicked inside the map or outside it
within or outside the boundry...
(the thing is that i dont want to allow the user to click outside the boudries
Regards
Regards
Ramy
|
|
|
|
|
look at the mousedown event. the e argument has 2 properties x,y you can check the numbers to make sure the mouse is within the picture by determining when the boundries stop--
ex: picture 400*300
if x > 10 andalso y > 10 andalso x < 400-10 andalso y < 300-10 then
' within
else
' boundry
end if
|
|
|
|
|
thx for answering
i havent tried thi yet
but i donu if it will work on a map- i mean the shape of the picture is not a sqaure or circle...
any way will try it
thx
Regards
Ramy
|
|
|
|
|
first thx for helping
i guess till now what u told me what s not succeeded
dont u think there is an method or function to determine boundaries ?
note the map(picture) is with black boundry and filled in white...
no other shapes or lines within the boundaries
thx
Regards
Ramy
|
|
|
|
|
charchabil03 wrote: dont u think there is an method or function to determine boundaries ?
The boundries of a image? No, there isn't. You have to supply those boundries yourself or code your own edge detection algorithm to figure them out.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: You have to supply those boundries yourself
How is that??
Dave Kreskowiak wrote: or code your own edge detection algorithm to figure them out.
any hint for that?
Regards
Ramy
|
|
|
|
|
Just like image maps in HTML, you have to draw the boundries of each "region" of the map that's clickable and check for mouse clicks inside those regions.
Read this[^] for an explanation of what an "image map" is and the concept behind it. You'll have to implement your own functionality to implement this since there is nothing in Windows Forms that will do it for you.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi,
can any one tell me how to create a button in the title bar. just like a minimise button in the title bar.
|
|
|
|
|
There is no support for this built into the .NET BCL. You'll have to create your own support for this from scratch.
Basically, you have to handle all the window messages releated to the non-client area of your form, including painting and non-client hit testing of mouse clicks to see if your button was clicked on. Overriding your form's WndProc method is how you accomplish this. Painting your button in the correct place and keeping it visible are NOT easy. You have to have an in-depth knowledge of how Windows works and window messages work and why. I haven't found any tutorial that explains this to beginners.
You can find an example of overriding WndProc here[^], but it doesn't go into any depth about what window messages you have to handle to pull off what you want to do.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
Does anyone know of a good site which explains how to get use popup messages in vb.net? Hopefull one which doesn't involve javascript. If the only way is through javascript, then so be it.
Please help. Thank you.
|
|
|
|
|
Your reference to jscript makes me assume you're doing ASP.NET. In which case, jscript is it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You are correct. I am using asp.net in VB. Seeing as, according to your reply, the solution is thru javascript, do you know of any good sites I can learn from? Just for the popup message boxes (for now).
Thanks for the reply.
|
|
|
|
|
hi,
can any one help vb6.0 should send emails without using outlook or sqlserver
tx
|
|
|
|
|
How does SQL Server factor into it ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
google "cdosys" you can create an object to send email (you need an email system to send the request through however, it won't do it on it's own)
|
|
|
|
|
when i used smtp.gmail.com it is giving an error STARTSLL some thing like that
can any one help me
|
|
|
|
|
Dear friends!
actually i am trying to create a login form which should load b4 or after logon in the windows,thery validating users r allowed to access the system.
I want to implement this using windows services!
pls Guide me.
thanks
sezhi
|
|
|
|