|
trg5030 wrote:
Public Sub AddDelete()
Dim Add As New frmAdd
ReDim Preserve objInfo(Count)
objInfo(Count) = New CD
With objInfo(Count)
Add.txtArtist.Text = .Artist
Add.txtAlbum.Text = .Album
Add.txtCDID.Text = .CDID
Add.txtCDLocation.Text = .CDLocation
Add.txtReleaseDate.Text = .ReleaseDate
If Add.rbYes.Checked = True Then
.Burned = True
End If
End With
Count = Count + 1
End Sub
Your making a new instance of an frmAdd form here. You then expand an array and add a new (blank) CD object to it. Then, your populating the textbox controls on the form with the information from the newly created CD object, with is all blanks. You then check a checkbox control on the form, which is never displayed by the way, and then increase the counter.
All the assignments to made are moving data (blank data) TO the form, but never FROM the form to the storage class you made!
RageInTheMachine9532
|
|
|
|
|
i reversed the statment to say
.artist = add.txtartist.text and i still get no data?
|
|
|
|
|
That's because everything you created in this sub is brand spanking new! Your not using the data from the EXISTING form at all, you're using it from a form that you create in this sub, but NEVER display. So yes, you're adding a bunch of blank information to your new CD object.
Use the EXISTING Add form you have already displayed (at least I think you did) instead of creating a new one in your sub.
RageInTheMachine9532
|
|
|
|
|
|
Hello, I´m programming a Security module for an application. To check out piracy i've been asked to verify the hard drive serial number and the BIOS serial number. I finally found a way to get hd's, but still haven't found a way to BIOS.
Can anyone help me?
Thank you anyway.
|
|
|
|
|
Troyax wrote:
I finally found a way to get hd's, but still haven't found a way to BIOS.
Easy enough to get the drive's serial number through WMI. Win32_LogicalDisk has the VolumeSerialNumber attribute.
The BIOS on the other hand isn't so easy. It's in the WMI Win32_BIOS class, but, not every BIOS HAS a serial number. My serial number on my Phoenix BIOS'd machine is "xxxxxxxxxxx". You'd be better off using various parts of the Win32_BIOS class and other pieces of information from other classes to generate your own serial number.
RageInTheMachine9532
|
|
|
|
|
Hi all,
I have a webservice (asmx) and i want to make a reference in a client project.
The problem is that i only see my datasets. We're only talking about design (not runtime environment).
example:
The webservice is called X and contains:
a dataset called ds
a function called GetDs()
The reference in the client-project is called R.
R.ds -> he finds it perfectly.
R.GetDs() -> doesn't show up in the list and gives an error when I want to use it (design time)
There's something more odd in it. R contains something called X ?!
When I call the server (asmx) I see the methods and all and they work perfectly fine.
Is there something I forgot when I builded the webservice or is there something wrong in the reference?
Your help would be greatly appreciated,
Christophe
|
|
|
|
|
I m doing on a project which requires me to do a binary file comparison. Can anyone help? How do i go abt coding it?
|
|
|
|
|
Sounds like a homework project. We can't write the code for you. You'll have to start writing the code and then we can help with specific problems.
RageInTheMachine9532
|
|
|
|
|
Private Sub CompareBinaryFiles(t1 As String, t2 As String)
Open txtOne.Text For Binary Access Read As #1
Open txtTwo.Text For Binary Access Read As #2
Dim pos As Long
Dim differencepercentage As Single
Dim o As Byte, t As Byte
Dim textOne As String, textTwo As String
Dim totalcount As Integer, differencecount As Integer
'need to initalize before computing
totalcount = 0
differencecount = 0
On Error GoTo exit2
'loop the file until EOF
Do Until EOF(2)
'count + 1 whenever the file loop
totalcount = totalcount + 1
'calculating the positioning of the file
pos = pos + 1
pos2 = pos2 + 1
If pos > txtOne Then GoTo exit2
Get #1, pos, t
Get #2, pos, o
'add the countdiffernces by 1
If t <> o Then lstMistakes.AddItem "Byte " & pos & " - " & t & " (" & o & ")"
If t <> o Then differencecount = differencecount + 1
'DoEvents
If pos Mod 256 = 0 Then PB.Value = pos
Loop
GoTo esc
exit2:
If pos2 = cut Then GoTo esc
lstMistakes.AddItem "---File ended at byte " & pos2 & " ---"
esc:
lstMistakes.Visible = True
PB.Visible = False
Close #1
Close #2
'calculating the percentage of the differnces of files
On Error GoTo errhandler
'differencepercentage = (differencecount / totalcount) * 100
List2.AddItem "Binary Compare Similarity :" & 100 - differencepercentage & " %"
List2.AddItem "Binary Compare diffences :" & differencepercentage & " %"
Exit Sub
errhandler:
Resume Next
End Sub
Is this the way to do the binary files comparison? But when i include this function my normal text files comparison will have a extra line at the end of each documents!
|
|
|
|
|
I am trying to write add-in to open a specified word document with
write and read permission for now it only gives me readonly permission with
a message saying this documne is been used by myself.
Dim WApp As Object
Set WApp = CreateObject("Word.Application")
'WApp.ReadOnly = False
WApp.Documents.Open str_FullPathToDownloadedFile, ReadOnly:=False
what could be the problem?
Shin
|
|
|
|
|
Did you run the same code before? And when you ran it before, did you close the document and shut down the instance of Word you created? If not, then a) there are 1...N instances of Word running (check your task list) and b) odds are, your word document is in use by one of them.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
>N instances of Word running (
you are right sometimes when i launch the word document it doesn't show up the winword.exe is there? i'm not sure why. by the way, do you know where i can look for help with these object class for office
application.name
application...
it's not in msdn right!? this only for add-in project?
Thanks for your help.
Shin
|
|
|
|
|
Some of it is here[^], but the best bet is to look right inside the help file for Word, etc., the go to the section called "Programming Information".
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
thanks for the information
I just found and bought a book called "visual basic Add-in" from o'relly.
I will study bit more before dive into the add-in
I really appreciate your input.
Shin
|
|
|
|
|
Hi,
I am new to VB6 Programming, can anybody suggest where and how to begin from?
Thanks in advance
Vikas
|
|
|
|
|
* MSDN still contains stuff on VB6.
* CodeProject has a variety of samples and articles still geared towards VB6.
* Try Googling "Visual Basic 6.0"
* There are a variety of other VB community sites that, although placing a more visible emphasis on VB.NET, still contain plenty of things regarding VB6.
* Check out Amazon.com and see what books are still available.
All in all, there are still things to do with VB6 and still companies interested in doing them... but if you are just starting out, odds are that you're not going to get up to speed too quickly, and by the time you do, the VB6 stuff is going to be less prevalent than it is today. So, my last suggestion is this: why not start learning VB.NET?
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
If you are trying to get into vb.net, a site co-authored by me may be helpful. Our site is mainly meant for beginners.... you may not find much advanced stuff. I still depend on codeproject for advanced topics.
See my tutorials : http://www.dotnetspider.com/Technology/Tutorials/
----------------------------------------------------------------------
T Manjaly
C# Tutorials and samples : http://www.dotnetspider.com
|
|
|
|
|
If any one know about the procedure, to read images in Vb.net please help me.
about the classes, methods how i can read the image (bitmap image, monochrome bitmap) , its pixels. Please guide me.
Sarmad
|
|
|
|
|
This depends entirely on the type of images you want to support. The .NET FCL supports a few image type natively. All you need to do is create a Bitmap object and give it the path of a file that has the image you want.
If you want to support other images, you're going to need the specifications on the file format and, the pixel format that it uses so you can write your own class to handle that kind of image.
RageInTheMachine9532
|
|
|
|
|
There are some built-in classes in the .NET Framework to help manipulate images. Below is some code I wrote to resize an image on my machine and serve it back to the user. Keep in mind that this page (.aspx) would be in the <img> tag indicating where to find the file.
<br />
Public Class SizeImage<br />
Inherits System.Web.UI.Page<br />
<br />
#Region " Web Form Designer Generated Code "<br />
<br />
'This call is required by the Web Form Designer.<br />
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()<br />
<br />
End Sub<br />
<br />
'NOTE: The following placeholder declaration is required by the Web Form Designer.<br />
'Do not delete or move it.<br />
Private designerPlaceholderDeclaration As System.Object<br />
<br />
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init<br />
'CODEGEN: This method call is required by the Web Form Designer<br />
'Do not modify it using the code editor.<br />
InitializeComponent()<br />
End Sub<br />
<br />
#End Region<br />
<br />
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
'Put user code to initialize the page here<br />
Dim ImageURL As String<br />
Dim Width, Height, imageWidth, imageHeight As Integer<br />
Dim ScaleFactor As Double<br />
<br />
Dim FullImage As System.Drawing.Image<br />
Dim ThumbImage As System.Drawing.Image<br />
Dim dummyCallBack As System.Drawing.Image.GetThumbnailImageAbort<br />
<br />
'Get the stuff off the Querystring<br />
ImageURL = Request.QueryString.Item("ImageURL").ToString<br />
ImageURL = Server.UrlDecode(ImageURL)<br />
ImageURL = Server.MapPath(ImageURL)<br />
Try<br />
Width = Request.QueryString.Item("Width")<br />
Height = Request.QueryString.Item("Height")<br />
Catch ex As Exception<br />
Width = 120<br />
Height = 120<br />
End Try<br />
<br />
'Setup to be able to return the thumbnail<br />
dummyCallBack = New _<br />
System.Drawing.Image.GetThumbnailImageAbort(AddressOf ThumbnailCallback)<br />
<br />
'Let's go get this image<br />
FullImage = System.Drawing.Image.FromFile(ImageURL)<br />
<br />
'Let's get the image's dimensions<br />
imageWidth = FullImage.Width<br />
imageHeight = FullImage.Height<br />
<br />
'see if we need to size this image<br />
If imageWidth > Width OrElse imageHeight > Height Then<br />
'Figure out which dimension is the bigger of the two<br />
If (imageWidth - Width) >= (imageHeight - Height) Then<br />
'The width will be the dimension scale, or it's a square<br />
'in which case, this will work just fine.<br />
ScaleFactor = Width / imageWidth<br />
Else<br />
'The height is the limiting dimension, so scale based on that<br />
ScaleFactor = Height / imageHeight<br />
End If<br />
'Use the determined scalefactor to get the dimension size we need for each dimension<br />
Width = ScaleFactor * imageWidth<br />
Height = ScaleFactor * imageHeight<br />
'Rotate/Flip twice (end up with original image, still)<br />
'This is done so the EXIF thumbnail is not used<br />
FullImage.RotateFlip(RotateFlipType.Rotate180FlipNone)<br />
FullImage.RotateFlip(RotateFlipType.Rotate180FlipNone)<br />
ThumbImage = FullImage.GetThumbnailImage(Width, Height, dummyCallBack, IntPtr.Zero)<br />
Else<br />
ThumbImage = FullImage<br />
End If<br />
ThumbImage.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg)<br />
<br />
'Cleanup area<br />
ThumbImage.Dispose()<br />
FullImage.Dispose()<br />
End Sub<br />
<br />
Function ThumbnailCallback() As Boolean<br />
Return False<br />
End Function<br />
<br />
End Class<br />
|
|
|
|
|
You can use the Bitmap class. Reading the pixels is as easy as using its GetPixel method. You'll also probably need the PixelFormat property of Bitmap too. Read up on the Bitmap class documentation here[^].
RageInTheMachine9532
|
|
|
|
|
Hey all,
I am writing a program which needs to search a small network for computers and their shared files and folders, I was hoping to find a way to do this in a similar way to a logical drive, but to no avail. Has anyone got any suggestions, or ideas on how I might do this.
Thanks,
Ciaran.
|
|
|
|
|
Windows Networking support in the .NET FCL is currently, well, horrible. There is no support whatsoever.
You're going to have to use the WinNet API calls to enumerate the machines and shares. Docs on the API's start here[^].
Support for WNet should be better in the .NET Framework 2.0...
RageInTheMachine9532
|
|
|
|
|
Hi,
I am trying to develop a custom metadata editor for ArcCatalog(ArcGIS), using VB.NET. I am using a COM component into my application. i am using esriObjecLibrary 1.0 into my reference, and its a .dll project, using VisualStudio.NET 2003. this metadata editor will be a pluging into ArcCatalog.
after writing the code, when i compile the project it says "Unable to emit assembly: Referenced assembly 'Interop.StdType' does not have a strong name"..
I went to the DOS prompt and gave a strong name to the assembly and added the assembly file into my AssemblyInfo.vb file, but still its not working.
if any of you have worked on this and know much about it, i will appreciate ur help...if u have worked on similar problem using C#.NET that will be of much help...
Thanks
software Used:
Visual Studio.NET 2003
ArcGIS 8.2
VB.NET
Platform: win2k
vijay
|
|
|
|