|
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
|
|
|
|
|
Hi All,
I have a aspx page that creates a RTF document. In the rtf doc I need to create links to other webpages. Does any one know how to programatically create links in RTF. I have been trying to figure this out for 3 days with no luck.
Thanks
|
|
|
|
|
Hello everyone!
I am getting some problems with my application.
The problem is that after developing the setup of my application I have installed it to two different computers. One is using Windows XP and other uses Windows 98 as Operating system. My application works perfectly on a system having windows xp, but with system having windows 98 it gives error when my user try to print a text file. The error message says:
Object reference is not set to the instance of the object
Also the details shows that there are some problems in Print Preview control's page information.
Can anyone figure out what's the problem is?
I am confused with this problem.
I have checked many times but its working fine only in Windows XP or 2000 or higher that 98.
Can anyone help me?
Waiting for any reply.
Thanx in advance.
|
|
|
|
|
I want to generate the keys for my software in VB.NET . I have to go according to this..
1. Each key is of 16 character length.
2. The last 2 digits are supposed to represent the version of the software; besides this it has no other significance.
3. The 16-character key is divided in 2 digit pairs as shown below –
AA BB CC DD EE FF GG 10
• String concatenation of AA and DD should be divisible by 49
• String concatenation of BB and EE should be divisible by 53
• String concatenation of CC and FF should be divisible by 59
• String concatenation of EE and GG should be divisible by 67
Will anyone tell me how to generate the keys ..
If u help me with code , It will be great as i need it urgently
REgards
Miss Rajender
|
|
|
|
|
I am having a problem copying a file to a remote location using .copyfile . My coding works fine when the destination is a local path, but when using the same coding for a remote location it doesn't work. I have tried using fs.copyfile "C:\Documents and Settings\Administrator\My Documents\data.file", "C:\Documents and Settings\Administrator\NetHood\mypath.net\public_html\data.file" as well as fs.copyfile "C:\Documents and Settings\Administrator\My Documents\data.file", "ftp://username:password@mypath.net\public_html\data.file" neither of which has worked.
Does anybody know how to do this?
David Goodman
President
Diverse Computing
~He who laughs last, thinks slowest~
|
|
|
|