如何防止免费分发商业Excel电子表格 [英] How to prevent free distribution of a commercial Excel spreadsheet

查看:41
本文介绍了如何防止免费分发商业Excel电子表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定在其他SE网站(超级用户)下是否更合适.

I'm not sure if this is more appropriate under a different SE site (Super User?).

我想构建并销售一个复杂的,由宏驱动的电子表格,并将其出售给特定的行业.我主要关注的是该行业内客户之间的免费/未经授权的分发.

I want to build and sell a complex macro driven driven spreadsheet to a certain vertical. I am mainly concerned about free/unauthorised distribution between customers within that vertical.

我可以看到市场上有一些晦涩的产品可能可以满足我的要求,但是我能找到的一些评论并不受欢迎.

I can see that there is a few obscure products on the market that might be able to do what I want, but the few reviews that i've been able to find haven't been favourable.

但是,一个供应商列出可以通过以下任一方式来绕过免费分发:

One vendor however lists that free distribution can circumvented by either:

  • 使用密钥生成器创建许可证代码
  • 使用在线激活功能
  • 或者仅使用加密的密码

有人知道我有什么指导方针/框架(任何语言)来构建自己的解决方案来实现这一目标,即需要许可证代码或在线激活吗?

Is anyone aware of any guidelines/frameworks (any language) for me to build my own solution to achieve this, namely requiring licence codes or online activation?

如果这通常是一项艰巨的任务,那么有没有人推荐的商业产品?

If this is generally a difficult endeavour, is there a commercial product that anyone recommend?

我还认为实现此目标所涉及的复杂性可能会促使我构建一个小型SaaS应用程序.我最好走那条路吗?

I'm also thinking the complexities involved in achieving this might push me to building a small SaaS application instead. Am I better off just going that route?

推荐答案

我创建了一个Excel工作表,如果每月的订阅付款失败,我可以远程删除对它的访问.这是完成此操作的方法:

I have created an Excel sheet that I could remotely remove access to if a monthly subscription payment failed. Here is how to accomplish this:

  1. 创建HTML表格并将其上传到您的网站

  1. Create and HTML table and upload it to your website

在您的Excel文档中,转到数据"标签,然后选择从网络获取"-将表导入名为验证"的工作表中-确保表有3列.序列号在第一列中,用户说明在第二列中,并且您的错误消息在第3列的顶部.此处存储的错误消息是未注册的每个用户都会看到的内容.第一个序列号应显示在验证"表的单元格A2中.

Within your Excel doc go to the data tab and select get from web - import your table into a sheet called "Verify" - make sure your table has 3 columns. Serial Number is in the first column, description of user in 2nd, and your error message in the top of col 3. The error message stored here is what every user that isn't registered will see. The first serial number should appear in cell A2 of the sheet Verify.

在您的Visual Basic编辑器中,将此代码粘贴到模块中-该代码将根据PC的硬盘驱动器序列号返回一个8位数字的序列号:

Within your Visual Basic editor paste this code into a Module - This code will return an 8 digit serial number based on a PC's Hard Drive serial number:

Function HDSerialNumber() As String
     Dim fsObj   As Object
    Dim drv     As Object
    Set fsObj = CreateObject("Scripting.FileSystemObject")
     Set drv = fsObj.Drives("C")

    HDSerialNumber = Left(Hex(drv.SerialNumber), 4) _
         & "-" & Right(Hex(drv.SerialNumber), 4)
End Function

还要在另一个模块中,确保Internet已连接.如果没有互联网,则工作表将关闭.如果您不这样做,那么如果有人断开与Internet的连接,则不会加载您的序列号.

Also in another module I make sure the Internet is connected. If no Internet then the sheet closes. If you don't do this then if someone disconnects from the Internet your serials won't be loaded.

Option Explicit
#If VBA7 And Win64 Then
    Private Declare PtrSafe Function InternetGetConnectedStateEx Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal lpszConnectionName As String, ByVal dwNameLen As Integer, ByVal dwReserved As Long) As Long
#Else
    Private Declare Function InternetGetConnectedStateEx Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal lpszConnectionName As String, ByVal dwNameLen As Integer, ByVal dwReserved As Long) As Long
#End If


Function IsInternetConnected() As Boolean

Dim strConnType As String, lngReturnStatus As Long, MyScript As String

    If Application.OperatingSystem Like "*Macintosh*" Then
        MyScript = "repeat with i from 1 to 2" & vbNewLine
        MyScript = MyScript & "try" & vbNewLine
        MyScript = MyScript & "do shell script ""ping -o -t 2 www.apple.com""" & vbNewLine
        MyScript = MyScript & "set mystatus to 1" & vbNewLine
        MyScript = MyScript & "exit repeat" & vbNewLine
        MyScript = MyScript & "on error" & vbNewLine
        MyScript = MyScript & "If i = 2 Then set mystatus to 0" & vbNewLine
        MyScript = MyScript & "end try" & vbNewLine
        MyScript = MyScript & "end repeat" & vbNewLine
        MyScript = MyScript & "return mystatus"
        If MacScript(MyScript) Then IsInternetConnected = True
    Else
        lngReturnStatus = InternetGetConnectedStateEx(lngReturnStatus, strConnType, 254, 0)
        If lngReturnStatus = 1 Then IsInternetConnected = True
    End If
End Function

然后在Workbook_Open区域内粘贴以下内容:

Then inside the Workbook_Open area paste this:

Private Sub Workbook_Open()

If IsInternetConnected Then

Dim objFSO As Object
Dim MyFolder As String
Dim sFileName As String
Dim iFileNum As Integer
Dim sBuf As String
Dim trialstartdate As String
Dim z As String

Dim fsoFSO
Set fsoFSO = CreateObject("Scripting.FileSystemObject")


'UNCOMMENT below to SHOW the serials sheet when the workbook is opened
ActiveWorkbook.Sheets("Verify").Visible = xlSheetVisible

'UNCOMMENT below to hide the serials sheet when the workbook is opened
'ActiveWorkbook.Sheets("Verify").Visible = xlSheetVeryHidden

Refresh_Serials
    z = 2
    'loop here for valid hard drive serial number
    Do Until IsEmpty(Worksheets("Verify").Cells(z, 1).Value)
        If Worksheets("Verify").Cells(z, 1).Value = HDSerialNumber Then
        'verified and let pass

        GoTo SerialVerified
        End If
        z = z + 1

        Loop

Dim custommessage As String

custommessage = Worksheets("Verify").Cells(2, 3)

MsgBox custommessage + " Your serial number is: " + HDSerialNumber

            Dim wsh1, MyKey1
            Set wsh1 = CreateObject("Wscript.Shell")
            MyKey1 = "%{TAB}"
            wsh1.SendKeys MyKey1


             MsgBox "The Commission Tracker will not open without a valid serial number. It will now close. uncomment this in workbook->open to close the workbook if the serial isn't found"
            Application.DisplayAlerts = False
            'uncomment this to close the workbook if the serial isn't found
             'ActiveWorkbook.Close
            Application.DisplayAlerts = True

SerialVerified:

' does the end user agree to not use this tool for mailicous purposes?

MsgAgree = MsgBox("Your PC's serial number is " & HDSerialNumber & ". By clicking 'Yes' you agree to use our software as described in our end user agreement. - the URL to your terms here", vbYesNo, "Final Agreement")

    If MsgAgree = vbNo Then
    'close program
    MsgBox "This program will now close since you do not agree to our end user agreement"
        Application.DisplayAlerts = False
    ActiveWorkbook.Close
    Application.DisplayAlerts = True

    Else
    'continue to open the program

    End If

Else
   MsgBox "No Network Connection Detected - You must have an internet connection to run the commission tracker."
    Application.DisplayAlerts = False
    ActiveWorkbook.Close
    Application.DisplayAlerts = True
End If


End Sub

应该这样做....

这篇关于如何防止免费分发商业Excel电子表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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