如何添加代码以查找运行我的应用程序的USB闪存驱动器的序列号? [英] How do I add code to find the serial number of the USB flash drive tha my application is running from?

查看:132
本文介绍了如何添加代码以查找运行我的应用程序的USB闪存驱动器的序列号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的软件添加一层保护,我可以使用我销售的闪存驱动器上的序列号或可用空闲字节硬编码每个程序。



作为一名使用Visual Basic 2010 Express的大杯程序员,但是一位知识渊博的工程师我正在向学生销售使用MS Forms应用程序的教程。我的问题是,学生们正在与全班同学分享我的应用程序(复制我的程序)并减少我的销售额。



我需要帮助来编写一个完整的项目才能获得这个信息。



感谢所有人的期待。 :-)



我尝试过:



I am trying to add a layer of protection to my software where I can "hard code" each program sold with the serial number of or the free space in bytes available on the flash drive that I sell it on.

Being just a mug programmer using Visual Basic 2010 Express, but a knowledgeable engineer I am selling tutorials using "MS Forms" applications to students. My problem is that students are sharing my applications (copying my programs) with their whole class and reducing my sales.

I need help to write a complete project to get this information.

Thanking you all in anticipation. :-)

What I have tried:

Public Class Form1

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        


    Public Function GetDriveSerialNumber() As String
        Dim DriveSerial As Integer
        'Create a FileSystemObject object
        Dim fso As Object = CreateObject("Scripting.FileSystemObject")
        Dim Drv As Object = fso.GetDrive(fso.GetDriveName(Application.StartupPath))
        With Drv
            If .IsReady Then
                DriveSerial = .SerialNumber
            Else    '"Drive Not Ready!"
                DriveSerial = -1
            End If
        End With
        Return DriveSerial.ToString("X2")
    End Function

End Class

推荐答案

检查我过去的答案:

允许表单仅在笔驱动程序内打开 [ ^ ]

如何在XP中获得usb序列号C#[ ^ ]



欲了解更多详情,请参阅:

NutShell中的USB - 第5章 - USB描述符 [ ^ ]
Check my past answers:
Allow the form to open only inside the pen driver[^]
How do I get usb serial number C# in XP[^]

For further details, please see:
USB in a NutShell - Chapter 5 - USB Descriptors[^]


你说你是硬编码每个出售的节目。



然后简单地在你的应用程序中嵌入购买者的名字和/或电子邮件,并用用户的信息水印所有内容。



Safari书籍做了/做了类似的东西。



你可以自动化这个过程;如果你计划在你的id筹码中修补,请记住检查金额。
You say you are "hard coding" each "program sold".

Then simply imbed the "purchaser's" name and / or email in your app, and "water mark" everything with the user's info.

Safari books did / does something similar.

You can probably automate the process; keeping "check sums" in mind if you plan to "patch" in your "id chips".


这篇关于如何添加代码以查找运行我的应用程序的USB闪存驱动器的序列号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆