|
|
The problem is that those points in the string make it an invalid number. If the output of the string as a number should just be something like 60028001622 (without the points) you should first remove the points:
filever = filever.Replace(".", "")
Another problem could be the size of the resulting number. Try to use long (or even decimals) to be able to work with larger numbers.
But the better (although a bit more complicated) way would be (like Colin already stated) to split your version into several numbers and test every number separately.
|
|
|
|
|
Thanks Colin and Robert.
After doing some testing, the best way to compare the version is what Colin suggested (split the version into several numbers and compare each one, and set the flag if file version is less).
Although at first I thought that Decimal data type would be appropriate for file version format(6.00.00.2825), but Decimal only accepts one point(.) and 28 places to the right of the decimal.
So my only or best option is splitting the number and comparing each one.
Thanks guys for the help!!
Enes M
|
|
|
|
|
Hi i using this Sample for VB.Net
http://www.freevbcode.com/AuthorInfo.asp?AuthorID=6163
I need update for Close Connections.
API is : SetTcpEntry
Declare Function SetTcpEntry Lib "IPhlpAPI" (ByRef pTcpRow As MIB_TCPROW) As Integer
Inside Command1_Click and area With TcpTableRow, inserting this code for test :
If CStr(GetTcpPortNumber(.dwRemotePort)) = "1452" Then
MsgBox("Found")
.dwState = 12
SetTcpEntry(TcpTableRow) --> BreakPoint
End If
1452 is remote port the my Laptop connected to Game Server in my PC.
I looking using Netstat -n
This Stop in BreakPoint but not Close Connection.
ny idea or Sample Code working ?
|
|
|
|
|
i m using an ASP.NET Web Appication n want to open Text files, PDFs and images on the VB.NET interface... so wat are the components which i need to open these files...
so far.. the images are being opened in Internet Explorer only.. which i dont want.. i want a specific component for both images and text/PDFs
need help how to do this ...
|
|
|
|
|
The System.IO namespace contains all you need to read/write text files. The Bitmap class in System.Drawing will open a bitmap from disc, and allow you to access it's information if you need it. There is no PDF support in .NET, that's why people advertise on this site selling PDF components to plug into .NET. However, a PDF is just text, so if you don't want to display it, you can read it the same as a text file. If it's not compressed ( which is rare ), you can even make changes, so long as the text you add is the same length as the text you remove.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hai ,
VB.NET
--------
Does anybody know how to do this,
i need to knw how to get a RGB values from a perticular image and put it to an three dimentional array using vb.Net
R G B R G B
62 12 85 125 190 104
25 2 135 205 120 95
42 25 145 180 166 75
95 32 193 175 145 115
this is the example of after cutting the image RGB values the array shoud like,
thank u,
suis
|
|
|
|
|
Here is one way to do it.
' Create a bitmap object from an image
Dim myBitmap As Bitmap = New Bitmap("Sunflowr.jpg")
' Get the Height and Width in pixels
Dim BitmapSize As Size = myBitmap.Size
' Holds the color of the pixel retieved from image
Dim PixelColor As Color
' 3-d Array to hold RGB values of color
Dim Rgb(BitmapSize.Width - 1, BitmapSize.Height - 1, 2) As Byte
For x As Integer = 0 To BitmapSize.Width - 1
For y As Integer = 0 To BitmapSize.Height - 1
PixelColor = myBitmap.GetPixel(x, y)
Rgb(x, y, 0) = PixelColor.R
Rgb(x, y, 1) = PixelColor.G
Rgb(x, y, 2) = PixelColor.B
Next
Next
|
|
|
|
|
Ok this is greate thnak u very much for u r time and help
thanks again.
i really appriate this.
suis
|
|
|
|
|
Please help me
i need to Take a set of images from a specified directory, and create a file containing colour histograms
computed from each of these images. The input images may be in any standard data format (such as
TIFF, GIF or JPEG).
how should i do this using vb.net
suis
|
|
|
|
|
Hi,
1. Open image: Dim b As Bitmap = new Bitmap("MyFile.bmp")
2. Get the color of one pixel: Dim c as Color = b.GetPixel(x, y)
3. Get the red/green/blue value from the color: Dim val As Integer = c.R/G/B
4. Count the needed values in some kind of loop
5. Write your results to a file (this can be done in various ways and depends on how your result output should look like)
|
|
|
|
|
Ok this is working nicely thnak u for u r help
suis
|
|
|
|
|
Read my C# image processing articles - if you can access the bitmap data in any way ( I'm not sure that you can, C# offers stuff VB.NET doesn't here ), then you should use those methods if you care at all about speed. Otherwise, do what he said
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am dealing with my own application (VB6 build) which uses specific visio files. from my application, i need to call a macro, which is runn from visio by double clicking a specific shape (with known ID & Name).
The problem is how to run this macro from my application, which is (the macro) is disabled in the visio.
|
|
|
|
|
Dear Friends,
I have Standard Package in VB6. When I am installing it on any computer I am getting error as below
1)msvcrt.dll can not used or can not registered
2)msado20.dll can not used or can not registered
please help me to solve these errors. Really I felt Nervous when i am installing my package at customer site.
Your help will be highly appriciated.
Thanks
Patel Murtuza
|
|
|
|
|
MSADO20.DLL????? How old is this thing?! Did you build this package and what version of VB did you use?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am using visual basic 6 and the package evry time i am making this problem is coming while installing
msvcrt and msado20 both error or some time one of them is getting problem
thanks
Murtuza
|
|
|
|
|
VB6.... It's very vague, but I seem to remember that you could ignore replacing the first file. The second file you should install anyway. Install MDAC and you'll get it. I'd go back through your Setup and Deployment wizard and remove the dependancy for this one.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I have a xml file with about 3 levels. I would like to convert this data into a tabular format. i.e., if the xml is of type:
<Company>
<GroupName>Technology
<Student>
<Name>
<FirstName>Bill</FirstName>
<LastName>Gates</LastName>
</Name>
</Student>
</GroupName>
<GroupName>Art
<Student>
<Name>
<FirstName>Da</FirstName>
<LastName>Vinci</LastName>
</Name>
</Student>
</GroupName>
<GroupName>Sports
<Student>
<Name>
<FirstName>Pete</FirstName>
<LastName>Sampras</LastName>
</Name>
</Student>
</GroupName>
</Company>
The output should be of the format:
GroupName FirstName LastName
********* ********* ********
Technology Bill Gates
Art Da Vinci
Sports Pete Sampras
Hope you got my problem. I do not want to use any dataset stuff. Can it be done using plain XML classes. I could get the data in name:value pairs. But from that how do i show them in a tabular format (say, on a label control) ?
Thanks in advance
Prasad P
|
|
|
|
|
Yes, it can be done. But this stinks of homework, so you'll have to at least make an attempt to write the code, first.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
Iam having one assignment that i want to run the command prompt through vb.net and to show the output in richtext box.
if any body knows the coding please help me.
|
|
|
|
|
Here is some code I had around to execute a program in DOS and redirect the output back into my program but I put it into a list box. Should be no big deal to use a RichText box.
Imports System.ComponentModel
Private ERROR_FILE_NOT_FOUND As Integer = 2
Private ERROR_ACCESS_DENIED As Integer = 5
' This code will execute a program on the file system
' and redirects output to this program.
Dim myProcess As Process = New Process
Try
Dim prgOutput As String
Dim strSplit() As String = Nothing
Dim delimStr As String = Chr(13) & Chr(10)
Dim delimiter() As Char = delimStr.ToCharArray()
myProcess.StartInfo.FileName = tbPath.Text
myProcess.StartInfo.Arguments = tbOptions.Text
myProcess.StartInfo.CreateNoWindow = True
' Must be false to be able to redirect DOS program output
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.RedirectStandardOutput = True
myProcess.Start()
myProcess.WaitForExit()
' Get the output from the DOS program
prgOutput = myProcess.StandardOutput.ReadToEnd
prgOutput = prgOutput.Replace(delimiter, "|")
strSplit = prgOutput.Split("|"c)
For i As Integer = 0 To (strSplit.Length - 1)
lbOutput.Items.Add(strSplit(i))
Next
Catch ex As Win32Exception
If ex.NativeErrorCode = ERROR_FILE_NOT_FOUND Then
Console.WriteLine((ex.Message + ". Check the path."))
Else
If ex.NativeErrorCode = ERROR_ACCESS_DENIED Then
Console.WriteLine((ex.Message + ". You do not have permission to _
print this file."))
End If
End If
End Try
|
|
|
|
|
hi
i had used the api to open the registry which is (copied from api text viewer).
RegOpenKeyEx(ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
where the first parameter values given in msdn are
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
when it use anyone of those it gives error that unknown symbol. tell me what to do these are not reserved work bydefault.
ddd
|
|
|
|
|
Hi;
You do not have to use win32 api's to read or write to the registry in Visual Basic. The .Net Framework has a class called RegistryKey which is better to use. Here is some code I wrote to get Windows IIS root directory from the registry.
Dim hive As RegistryKey = Registry.LocalMachine ' This the HKEY_LOCAL_MACHINE
Dim subKey As RegistryKey ' The path to to the subkey
Dim keyValue As String ' the value your looking for
subKey = hive.OpenSubKey("SOFTWARE\Microsoft\INetStp", False)
keyValue = CStr(subKey.GetValue("PathWWWRoot"))
hive.Close()
lblWWWRoot.Text = keyValue
--------------------------------
This link will take you to the documentation for RegistryKey
RegistryKey Members
--------------------------------
Just info, the constants HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HEY_LOCAL_MACHINE, HKEY_USERS are found in the Windows DDK include directory.
|
|
|
|
|
If your using VB.NET, the declaraiton you have won't work and isn't necessary. The .NET Framework has a Registry class that is easier to use than this.
If your using VB6, then go back to the very same APIViewer and use it to show you what the Constants are. There is a drop down box that will allow you to pick what your looking at.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|