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

原创 2006年06月09日 18:53:00

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

 

使用VB开发封装ASP的DLL例子

      封装为dll会带来很多的好处,主要包括只是产权的保护,以及效率和安全性能的提升。这个例子中被封装的dll文件可以隐藏access数据库的实际路径。VB生成的DLL封装ASP代码来连接数据库...

用ISAPI看ASP的实现

 用ISAPI看ASP的实现一.        前言 IASPI是IIS的的扩展接口,可以用它来实现动态网页。ASP就是使用ISAPI实现起来的一个扩展程序。本文是在了解了ISAPI技术后,来思考AS...

使用VB开发封装ASP的DLL例子

      封装为dll会带来很多的好处,主要包括只是产权的保护,以及效率和安全性能的提升。这个例子中被封装的dll文件可以隐藏access数据库的实际路径。VB生成的DLL封装ASP代码来连接数据库...

小宇宙就要爆发了:Google 的虚拟人脑即将投入使用

丁伟峰 发表于 2012/10/08-17:38 Google /Google X /Google虚拟人脑 这个夏天,我们 见证了神秘的 Google X终极实验室在人工智能领域树起了一...
  • peghoty
  • peghoty
  • 2013年10月08日 17:51
  • 1379

福建数字校园一卡通投入使用一卡一刷就搞定

在校园里,学生做什么都离不开卡:出入学校,要刷门卡;到食堂打饭,要刷饭卡;去图书馆借阅书籍,要出示借书卡……   今后,大学生们就不用带这么多卡了。只要掏出手机轻轻一刷,吃饭、洗澡、出入学校和宿舍…...
  • xqdd
  • xqdd
  • 2011年09月14日 09:24
  • 2353

大数据早报:亚马逊最大风力发电站投入使用 MongoDB上市首日股价飙涨34%(10.21)

数据早知道,上36dsj看早报! 来源36大数据,作者:奥兰多 『IBM』IBM 忘记续域名导致云服务出现问题 IBM 的负载均衡和反向 DNS 服务器上个月发生了长达 ...

6月20日广西海事系统内河40米级海巡船投入使用

6月20日上午,广西海事系统内河40米级海巡船“海巡1011”在南宁列编投入使用。...

中学生管理系统(已投入使用)

  • 2008年12月02日 17:34
  • 19.19MB
  • 下载

第一个小应用:图片浏览器 之五 动手开发

从Sd卡获得图片 GetPhoto.javapublic class GetPhoto { public static File getPhoto(Context context) { ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:自己动手开发的第一个即将投入使用中的ASP+DLL
举报原因:
原因补充:

(最多只允许输入30个字)