关闭

自己动手开发的第一个即将投入使用中的ASP+DLL

1555人阅读 评论(0) 收藏 举报

ASP文件调用:

location=trim(request("location")) 
 
 beginlevel=trim(request("beginlevel"))
 endlevel=trim(request("endlevel"))
powertype=trim(request("PowerType"))

Set PWLPrice1=server.createobject("PWLPrice.PowerLevel")
if powertype="FullTime" then
call PWLPrice1.GetPWLFullTimePrice(location, beginlevel, endlevel, currency_code, time2, Price, Price2)
else
call PWLPrice1.GetPWLPartTimePrice(location, beginlevel, endlevel, currency_code, time2, Price, Price2)
end if 
set PWLPrice1=nothing  
end if

 

DLL代码

'location 服务器类别
'beginlevel 代练开始级别
'englevel 代练完成级别
'currency_code 货币类型
'time2      代练时间
'ptrPrice1 市场价格
'ptrPrice2  折扣价格

Public Sub GetPWLFullTimePrice(location, beginlevel, endlevel, ByRef currency_code, ByRef time2, ByRef Price, ByRef Price2)
Dim btime As Single
Dim etime As Single

 

Dim t1 As Single
Dim t2 As Single
Dim t3 As Single
Dim t4 As Single
Dim t5 As Single
Dim t6 As Single
Dim t7 As Single
Dim t8 As Single
Dim t9 As Single
Dim t10 As Single
Dim t11 As Single
Dim t12 As Single
Dim t13 As Single
Dim t14 As Single
Dim t15 As Single
Dim t16 As Single
Dim t17 As Single
Dim t18 As Single
Dim t19 As Single


btime = 1
etime = 2
time1 = 0

                t1 = 1
                t2 = t1 + 3 * 1
                t3 = t2 + 3 * 2
                t4 = t3 + 3 * 2.5
                t5 = t4 + 3 * 3
                t6 = t5 + 3 * 4
              
                t7 = t6 + 3 * 4.5
                t8 = t7 + 3 * 5
                t9 = t8 + 3 * 5.5
                t10 = t9 + 3 * 6.5
                t11 = t10 + 3 * 7.5
               
                t12 = t11 + 3 * 8
                t13 = t12 + 3 * 8.5
                t14 = t13 + 3 * 9
                t15 = t14 + 3 * 9.5
               
                t16 = t15 + 3 * 10
                t17 = t16 + 3 * 10.5
                t18 = t17 + 3 * 11
                t19 = t18 + 3 * 12
               
    If beginlevel < 6 Then
           btime = 0
        Else
        Select Case Int((beginlevel - 1) / 3)
               Case 2: btime = t1 + (beginlevel - 6) * 1        ' L7-9
               Case 3: btime = t2 + (beginlevel - 9) * 2        '  L10-12
               Case 4: btime = t3 + (beginlevel - 12) * 2.5     '   L13-15
               Case 5: btime = t4 + (beginlevel - 15) * 3       '  L16-18
               Case 6: btime = t5 + (beginlevel - 18) * 4       '  L19-21
               Case 7: btime = t6 + (beginlevel - 21) * 4.5     '  L22-24
               Case 8: btime = t7 + (beginlevel - 24) * 5       '  L25-27
               Case 9: btime = t8 + (beginlevel - 27) * 5.5     '   L28-30
               Case 10: btime = t9 + (beginlevel - 30) * 6.5    '   L31-33
               Case 11: btime = t10 + (beginlevel - 33) * 7.5   '  L34-36
               Case 12: btime = t11 + (beginlevel - 36) * 8     '  L37-39
               Case 13: btime = t12 + (beginlevel - 39) * 8.5   '  L40-42
               Case 14: btime = t13 + (beginlevel - 42) * 9     '  L43-45
               Case 15: btime = t14 + (beginlevel - 45) * 9.5   '  L46-48
               Case 16: btime = t15 + (beginlevel - 48) * 10    '  L49-51
               Case 17: btime = t16 + (beginlevel - 51) * 10.5  '   L52-54
               Case 18: btime = t17 + (beginlevel - 54) * 11    '  L55-57
               Case 19: btime = t18 + (beginlevel - 57) * 12    '  L58-60
              
               End Select
         End If
              
        If endlevel <= 6 Then
           etime = 1
         Else
       Select Case Int((endlevel - 1) / 3)
               Case 2: etime = t1 + (endlevel - 6) * 1          'L7-9
               Case 3: etime = t2 + (endlevel - 9) * 2          'L10-12
               Case 4: etime = t3 + (endlevel - 12) * 2.5       'L13-15
               Case 5: etime = t4 + (endlevel - 15) * 3         'L16-18
               Case 6: etime = t5 + (endlevel - 18) * 4         'L19-21
              
               Case 7: etime = t6 + (endlevel - 21) * 4.5       'L22-24
               Case 8: etime = t7 + (endlevel - 24) * 5         'L25-27
               Case 9: etime = t8 + (endlevel - 27) * 5.5       'L28-30
               Case 10: etime = t9 + (endlevel - 30) * 6.5      'L31-33
               Case 11: etime = t10 + (endlevel - 33) * 7.5     'L34-36
               Case 12: etime = t11 + (endlevel - 36) * 8       'L37-39
                          
               Case 13: etime = t12 + (endlevel - 39) * 8.5     'L40-42
               Case 14: etime = t13 + (endlevel - 42) * 9       'L43-45
               Case 15: etime = t14 + (endlevel - 45) * 9.5     'L46-48
               Case 16: etime = t15 + (endlevel - 48) * 10      'L49-51
               Case 17: etime = t16 + (endlevel - 51) * 10.5    'L52-54
               Case 18: etime = t17 + (endlevel - 54) * 11      'L55-57
               Case 19: etime = t18 + (endlevel - 57) * 12      'L58-60
               End Select
         End If
        
            time1 = Round(etime - btime + 0.4999)
            time2 = time1
            If location = 1 Then
             currency_code = "USD"
               If time1 < 36 Then
               Price2 = Round(time1 * 0.792 * 1.2 * 10 / 8 + 0.49999)
               Price = Round(time1 * 0.792 * 1.2 + 0.4999)
               Else
               Price2 = Round(time1 * 0.792 * 10 / 8 + 0.49999)
               Price = Round(time1 * 0.792 + 0.4999)
               End If
            Else
             currency_code = "EUR"
               If time1 < 36 Then
               Price2 = Round(time1 * 0.792 * 10 / 8 + 0.49999)
               Price = Round(time1 * 0.792 + 0.4999)
               Else
               Price2 = Round(time1 * 0.66 * 10 / 8 + 0.49999)
               Price = Round(time1 * 0.66 + 0.4999)
               End If
            End If
           
           
End Sub
'location 服务器类别
'beginlevel 代练开始级别
'englevel 代练完成级别
'currency_code 货币类型
'time2      代练时间
'ptrPrice1 市场价格
'ptrPrice2  折扣价格
Public Sub GetPWLPartTimePrice(location, beginlevel, endlevel, ByRef currency_code, ByRef time2, ByRef Price, ByRef Price2)
Dim btime As Single
Dim etime As Single

Dim t1 As Single
Dim t2 As Single
Dim t3 As Single
Dim t4 As Single
Dim t5 As Single
Dim t6 As Single
Dim t7 As Single
Dim t8 As Single
Dim t9 As Single
Dim t10 As Single
Dim t11 As Single
Dim t12 As Single
Dim t13 As Single
Dim t14 As Single
Dim t15 As Single
Dim t16 As Single
Dim t17 As Single
Dim t18 As Single
Dim t19 As Single


btime = 1
etime = 2
time1 = 0
                t1 = 1
                t2 = t1 + 3 * 1
                t3 = t2 + 3 * 2
                t4 = t3 + 3 * 2.5
                t5 = t4 + 3 * 3
                t6 = t5 + 3 * 4
              
                t7 = t6 + 3 * 4.5
                t8 = t7 + 3 * 5
                t9 = t8 + 3 * 5.5
                t10 = t9 + 3 * 6.5
                t11 = t10 + 3 * 7.5
               
                t12 = t11 + 3 * 8
                t13 = t12 + 3 * 8.5
                t14 = t13 + 3 * 9
                t15 = t14 + 3 * 9.5
               
                t16 = t15 + 3 * 10
                t17 = t16 + 3 * 10.5
                t18 = t17 + 3 * 11
                t19 = t18 + 3 * 12
               
    If beginlevel < 6 Then
           btime = 0
        Else
        Select Case Int((beginlevel - 1) / 3)
               Case 2: btime = t1 + (beginlevel - 6) * 1        ' L7-9
               Case 3: btime = t2 + (beginlevel - 9) * 2        '  L10-12
               Case 4: btime = t3 + (beginlevel - 12) * 2.5     '   L13-15
               Case 5: btime = t4 + (beginlevel - 15) * 3       '  L16-18
               Case 6: btime = t5 + (beginlevel - 18) * 4       '  L19-21
               Case 7: btime = t6 + (beginlevel - 21) * 4.5     '  L22-24
               Case 8: btime = t7 + (beginlevel - 24) * 5       '  L25-27
               Case 9: btime = t8 + (beginlevel - 27) * 5.5     '   L28-30
               Case 10: btime = t9 + (beginlevel - 30) * 6.5    '   L31-33
               Case 11: btime = t10 + (beginlevel - 33) * 7.5   '  L34-36
               Case 12: btime = t11 + (beginlevel - 36) * 8     '  L37-39
               Case 13: btime = t12 + (beginlevel - 39) * 8.5   '  L40-42
               Case 14: btime = t13 + (beginlevel - 42) * 9     '  L43-45
               Case 15: btime = t14 + (beginlevel - 45) * 9.5   '  L46-48
               Case 16: btime = t15 + (beginlevel - 48) * 10    '  L49-51
               Case 17: btime = t16 + (beginlevel - 51) * 10.5  '   L52-54
               Case 18: btime = t17 + (beginlevel - 54) * 11    '  L55-57
               Case 19: btime = t18 + (beginlevel - 57) * 12    '  L58-60
              
               End Select
         End If
              
        If endlevel <= 6 Then
           etime = 1
         Else
       Select Case Int((endlevel - 1) / 3)
               Case 2: etime = t1 + (endlevel - 6) * 1          'L7-9
               Case 3: etime = t2 + (endlevel - 9) * 2          'L10-12
               Case 4: etime = t3 + (endlevel - 12) * 2.5       'L13-15
               Case 5: etime = t4 + (endlevel - 15) * 3         'L16-18
               Case 6: etime = t5 + (endlevel - 18) * 4         'L19-21
              
               Case 7: etime = t6 + (endlevel - 21) * 4.5       'L22-24
               Case 8: etime = t7 + (endlevel - 24) * 5         'L25-27
               Case 9: etime = t8 + (endlevel - 27) * 5.5       'L28-30
               Case 10: etime = t9 + (endlevel - 30) * 6.5      'L31-33
               Case 11: etime = t10 + (endlevel - 33) * 7.5     'L34-36
               Case 12: etime = t11 + (endlevel - 36) * 8       'L37-39
                          
               Case 13: etime = t12 + (endlevel - 39) * 8.5     'L40-42
               Case 14: etime = t13 + (endlevel - 42) * 9       'L43-45
               Case 15: etime = t14 + (endlevel - 45) * 9.5     'L46-48
               Case 16: etime = t15 + (endlevel - 48) * 10      'L49-51
               Case 17: etime = t16 + (endlevel - 51) * 10.5    'L52-54
               Case 18: etime = t17 + (endlevel - 54) * 11      'L55-57
               Case 19: etime = t18 + (endlevel - 57) * 12      'L58-60
               End Select
         End If
        
             time1 = Round(etime - btime + 0.499)
             time2 = time1
                                       
             If location = 1 Then
              
               If time1 < 36 Then
               Price2 = Round(time1 * 0.84 * 1.2 * 10 / 8 + 0.49999)
               Price = Round(time1 * 0.84 * 1.2 + 0.4999)
               Else
               Price2 = Round(time1 * 0.84 * 10 / 8 + 0.49999)
               Price = Round(time1 * 0.84 + 0.4999)
               End If
               currency_code = "USD"
             Else
              
               If time1 < 36 Then
               Price2 = Round(time1 * 0.84 * 10 / 8 + 0.49999)
               Price = Round(time1 * 0.84 + 0.4999)
               Else
               Price2 = Round(time1 * 0.7 * 10 / 8 + 0.49999)
               Price = Round(time1 * 0.7 + 0.4999)
               End If
               currency_code = "EUR"
              End If
End Sub

开发过程。编写DLL文件。注册DLL文件,ASP调用DLL对象。

Regsrv32.exe d:/dll/PowerLevel.dll

 

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:1210869次
    • 积分:15232
    • 等级:
    • 排名:第768名
    • 原创:294篇
    • 转载:60篇
    • 译文:2篇
    • 评论:188条
    文章存档
    最新评论
    C#+Jquery
    C#+Jquery