Function DelStr(Str)
If IsNull(Str) Or IsEmpty(Str) Then
Str = ""
End If
DelStr = Replace(Str,";","")
DelStr = Replace(EingDelStr,"'","")
DelStr = Trim(EingDelStr)
End Function帮我转一下VB,我封装成DLL,在ASP里调用

解决方案 »

  1.   

    Function DelStr(Str as string)
    If Str & "" ="" Then
       Str = ""
    End If
    DelStr = Replace(Str,";","")
                      下面的变量是怎么来的啊
    DelStr = Replace(EingDelStr,"'","")
    DelStr = Trim(EingDelStr)
    End Function
      

  2.   

    感觉好象代码有问题         Function DelStr(Byval Str as string) as string
    If IsNull(Str) Or IsEmpty(Str) Then
    Str = ""
    End If
    DelStr = Replace(Str,";","")
    DelStr = Replace(DelStr,"'","")
    DelStr = Trim(DelStr)
    End FunctionEingDelStr 这个变量从哪来的?按程序的逻辑应该直接使用 DelStr 就行了。这代码没问题了,只是声明部分稍改一下,放入 .cls 文件中编译就可以了。
      

  3.   

    哦对了,如果做DLL还要加上public关键字public Function DelStr(Byval Str as string) as string    '.....end function
      

  4.   

    多谢多谢,我先试试.中间的eingdelstr写错了,应该是delstr
      

  5.   

    提醒一下楼主,Str是VB中的内置函数,用str作变量名不合适。
      

  6.   

    Request.ServerVariables("LOCAL_ADDR")
    Request.ServerVariables("SERVER_NAME")
    在VB里可以直接这样使用吗?
      

  7.   

    ASP中如何调用DLL呀?==============
    <%
    set mydll=server.createobject("class1.mydll")
    'class1.mydll 是你的类名
    '比如你的类工程叫 class1,cls文件叫 mydll,那编译后类名就是 class1.mydllaa=mydll.delstr("1234")set mydll=nothingresponse.write aa
    %>