I am looking for a method to determine an applicants age from a masked text box(date). Below is what I am using but I wnat to utilize vb.net code instead of inherited datediff from VB6, also this method rounds off the age e.g 44.9 to 45 which is not acceptable.
Below is what I am currently using, looking for a better way.
Private _age As Int32
Private _SixQvar As Int32
'This determines the age of the client and sets the value of _SixQvar
When trying to determine the Architecture of an OS, I ran across IntPtr.From reading the documentation, I saw this: Quote:The IntPtr type is designed to be an integer whose size is platform-specific. That is, an instance of this type is expected to be 32-bits on 32-bit hardware and operating systems, and 64-bits on 64-bit hardware and operating systems.
Since the size of IntPtr is intended to be the size of the architecture, would it be feasible to test the size and determine the OS by that? Or is there a better way?
I was thinking there might also be a way via WMI, but I don't want to use that for compatibility reason.
I wrote this code to try and figure out which drive Windows is installed on - it basically starts with C and looks for the first "fixed disk" with a Windows folder.
' Start with c: and look for first fixed drive (type=3) with a windows folder Dim getInfo As System.IO.DriveInfo Dim m_start As Integer = 67 Dim m_drv As String = Chr(m_start) & ":windows" [Code] .....
I was trying to make a client/server application. Server listens at a specific port for an incoming connection and if there is a connection it accepts is and asks for a password. If password is correct then they simply wait for some "string" from eachother. everything is fine if I send and get data in string format. there is no problem at all!
(By the way I am using simple usual TcpListener/TcpClient, Networkstream, Binaryreader/writer, etc...
I decided to add file transfer option. well for that i needed to transfer data in byte arrays. Because of this I decided to make all data traffic in byte arrays. So I converted strings to arrays and arrays to string in between. In case of file transfer, file chunks are being sent with a cap like "[cap]"<data chunk>. This was my idea. On the other side there is a sub looking what is coming and what does it mean by looking its cap. In case of file transport specific cap, cap will be removed and data is being added to previous ones...
My problem was, that my binaryreader: reader reads incoming data without any parameter:
message=reader.readstring
But in case of readbytes i have to put a parameter called count. Well I don't know how much bytes are going to come until I get them. In case of TcpClient I can get it with: Client.GetStream.length.
But how can I get the same result with TcpListener? (At the server)
Can I transfer chunks of file bytes in string format and convert them back to bytearrays without any loss or problem?
how can i make it like IF (todays date is passed a specific date) then basically what i need is to see if the date is passed a static date i set in the vb code.
I am writing a simple program to perform a task at work. It is an update application that will allow end users to update software themselves.I have come up against a problem though. In order to fully complete the installation, the latest service packs have to be installed. The machines are either running XP or 2000 and need updating to the latest service packs.The problem is I cannot find any code that will let me determine the service pack, all I have is:
HTML MsgBox("Computer's operating system version: " & _ My.Computer.Info.OSVersion)
This finds the OS version, but I don't seem to be able to determine the SP from it. What I need to do is make a piece of code that will find the OS and SP, and then download the latest SP.The service packs are as follows: 2000 needs SP4 and Rollup 1 and XP needs SP3. I value will need to be returned and then stored to create and IF statemenet, but I am stumped on how to find the SP.
In my code behind I'd like to be able to tell that I'm running my web site project in Visual Studio (either Debug or Release).I was considering testing for "localhost" but that's not perfect because we could be testing it locally on the server.
In the TableAdapter configuration wizard I am using this query:
Code:
SELECT AttendanceID, StudentID, ClassId, DateOfClass, Absent FROM Attendance WHERE (DateOfClass BETWEEN #5/1/2010# AND #5/30/2010#)
Can tell me the correct syntax to change the #5/1/2010# AND #5/30/2010# so the WHERE clause uses dteStartDate AND dteStartDate which are date variables ?
I tried this but it tells me I need to use the to_date function. dteStartDate is already a date variable so I know my syntax is wrong.
Code:
SELECT AttendanceID, StudentID, ClassId, DateOfClass, Absent FROM Attendance WHERE (DateOfClass BETWEEN #" & dteStartDate & "# AND #" & dteEndDate & "#)
Is there any easy way to determine the IP address for the computer that an app is running on. I looked through the System.Net namespace and didn't see anything of the sort.
Basically, I want to display the IP address to the user, instead of walking them through how to do an "ipconfig". They then can put that IP address into another app, so the one app can talk to the other via UDP.
I have a dataset that is filled by a tableadapter and what I'm trying to do is to figure out how to loop through all of the rows in my dataset and determine when someone hasedited/changed the row and then
I have written simple code to determine country location using the suffix on the url eg..cn, .se, .br etc. even if its possible to determine country or location using urls that end in .com or .net? I was just reading up on something and found online apps that can determine location/country from the ip so how would I determine the ip or look it up using the url? can I do this in .net?
OK
So I have the following code and I get an exception when the url is invalid or faulty, can anyone help me to catch the error and add the url to another list and continue with my loop.
Public Sub getIpAddress(ByVal querylist As ArrayList) Dim IPList As New ArrayList Dim badList As New ArrayList[code].....
My current situation is a brain teaser for me, and I wish I could provide code that I have tried but quite frankly - i have no idea how to even start. So this is my situation; I have a tab control, this tab control holds the names of Departments for a Lay-Away manager. The user has the option to click a static tab, "New.." and add a new department. When that happens, the new tab controls name is added to the settings, and a new list-view is created, and named "lst & DepartmentName". The problem is, I have no way of knowing when the Double_Click event of the this list that may, or may not exist happens. I have a method of determining which list is currently active, working with a timer to set a certain value the name of the list, sort of like
Dim lst = GetAllList(TabControl1.SelectedTab) cList = lst.Item(0)
Considering there is only one listview per tab, it will always be 0. So, question is - How could I determine when that particular listviews Double_Click event happens ? Then I will use it to call a certain Button_Click event?
Through ACL I could restrict access to a directory in an NTFS-Formatted USB, what I want to do now is to be able to check if any virus/malware tried to infect my folder so I will know if it is safe to unlock the folder in that machine, is there any way in .Net that I can do this?
im using VB 2008 is it possible to get active window name or id? for example i have active notepad window, now how i can get it's process name or process ?id(better is process id)
Im creating a program that auto starts with my computer. On this program im adding a section that states how much space i have left on the C: drive. So far i have 2 labels and a progress bar. in the top level i have the name of what the progress bar is, and the second below the progress bar states the amount such as this "430GB/740GB". i also want the progress bar to state the percent of how full this drive is. how can i do the following:
Determine the amount of drive space on C: Determine the amount of free space on C: Make free space a percent of all space. such as "30% full"
I'm converted a VB6 project to vb.net using the convert tool.Now i have a few declares that included passing variables as "as any" which vb.net doesn't like and it seems you have to declare them as there correct type so i have the following,So i suppose , Long and Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory"(ByRef Destination As Any, ByRef Source As Any, ByVal Length As Integer) and
Long again?
Private Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Integer, ByVal nCode As Integer, ByVal wParam As Integer, ByRef lParam As Any) As Integer
I'm just asking for suggestions for a secure way of determining what type of application my VB.NET application will load as. For example, I intend to distribute my application to internal and external customers. There are differences in features etc. for internal and external customers. What secure way can I tell the application to load as 'internal' or 'external'? I want to avoid the command line (passing in an argument) or the application settings.
I've got this problem where I'm supposed to be determining whether a string is a word or not. not exactly.Its supposed to just make sure each string has at least 1 vowel, and each vowel is surrounded by consonants. If it meets those requirements it'll be accepted, if not it'll be rejected, but I've already got that part figured out. I think I know a horrible way to do it, that would take a very long time, but I'm thinking there has to be a much easier way..
I'm willing to create a program that will determine the size of a file imported in OpenFileDialog After a RAR Compression. I'm not sure what's the ratio of the rar compression,
I have a program which builds a child program during runtime, it all runs fine but I want I way of determining which computer it came from. It is private and when I give it to someone I get their volume serial number and I can identify who it is from that. Once they build their program which can be public so the same method won't work I want it to know it came from person.. pseudo code ex
I'm trying to write some generic code in VB.NET that determines whether or not a SQL server database table contains an identity column and, if so, to return the name of that column.I'm working in Visual Basic 2008 Express and have created a SQL database, "MyDatabase" with 1 table called "MyTable". Within that table, I've got 3 columns, "ID", "Column1" and "Column2". I know, I know... inventive names. Under column properties in the Database Explorer, I've set the "ID" column "Identity Specification" to "yes" and have set the "Is Identity" value to "yes"
I have a simple app that just shows the current time for specific locations around the world. I need to have it adjust for daylight savings time. I *THOUGHT* I'd already coded this but....
I thought I would use "Today.IsDaylightSavingTime()" and add 1 hour to the clocks. It isn't working?
If Today.IsDaylightSavingTime() Then HawaiiOffset = HawaiiOffset + 1 PacificOffset = PacificOffset + 1
I'm using VS2008. Is there anyway I can determine in my code whether or not the program is running as a debug EXE or a release EXE? I know you can see a lot of the project properties using My.Application.Info.
i need to alter the code to determine if an integer entered by a user is prime preferably to determine if the number entered (between 1 and 50 is even or odd and prime from 51 to 100) i have the code for listing primes from 51-100 (or whatever range needed)but can i condense the code to a smaller foot print rather than have three different sections for each request
In my order program, I need to determine if the quantity ordered is full boxes.For example - all of our parts/products have different box quantities, and when a customer orders a certain quantity, I want it to do nothing when I type in the quantity IF the order quantity is even boxes, If it is not even boxes, I want a pop up form with three radio buttons to come up. The three radio buttons will have the next higher even box quantity, the next lower box quantity, and to keep the current quantity and apply a broken box charge. I have this pop-up form done except for determining if the order quantity is an even number of boxes, and then determining the next higher and next lower.
Just to clarify - let's say a customer orders a part that has 60 pieces per box. If he orders 180 pieces, nothing happens and you can continue to put the order on. If he orders 200 pieces, a pop-up form with 3 selections - "keep current quantity and apply broken box charge", or "Change Quantity to 240", or "Change Quantity to 180" comes up.
I just started to use visual basic last month and I only know the basic codes. No matter how hard I try to understand the codes given by the other member, I can't understand it.So the program I'm making is to show all the inputted values and determine the even numbers, the odd numbers and the prime numbers.I don't know how to get the prime numbers.
Private Sub op1_Click() a = InputBox("Input Endpoint: ") For x = 1 To a
Is there any way to determine if the mouse scrolls up or down using the Mousewheel handler on a sub? [code]I want to be able to adjust the value of userzoom up or down according to if the mouse is wheeled up or down.