.cs方法 转成.vb 方法,急!

publicstringengShowPager(paramsstring[]parms){stringparmstr=string.Empty;for(inti=0;i... public string engShowPager(params string []parms)
{
string parmstr=string.Empty;
for(int i=0;i<parms.Length;i++)
{
string parmName=parms[i];
string parmValue=Request.QueryString[parmName];
if (parmValue != null)
{
if (parmstr == string.Empty)
parmstr = "&" + parmName + "=" + parmValue;
else
parmstr += "&" + parmName + "=" + parmValue;
}

}
string strpager=" "+RecordCount+" records Current "+PageIndex+"/"+PageCount+" "+
"<a href=\"?page=1"+parmstr+"\">HomePage</a> <a href=\"?page="+(PageIndex-1)+parmstr+"\">PageUp</a> <a href=\"?page="+(PageIndex+1)+parmstr+"\">NextPage</a> <a href=\"?page="+PageCount+parmstr+"\">LastPage</a>";
return strpager;
}
展开
 我来答
lzh3452
2012-01-12 · TA获得超过1044个赞
知道小有建树答主
回答量:1168
采纳率:100%
帮助的人:862万
展开全部
vb代码如下,另外,判断parmstr是否为空的那个If可以去掉,只保留Else就行了。
public engShowPager(params As string()) As string
{
Dim parmstr As string=""
for i As Integer =0 To parms.Length - 1
Dim parmName As string = parms(i)
Dim parmValue As string = Request.QueryString(parmName)
if Not parmValue Is Nothing Then
if parmstr = “” Then
parmstr = "&" & parmName & "=" & parmValue
else
parmstr &= "&" & parmName & "=" & parmValue
End If
Next
Dim strpager As string=" "&RecordCount&" records Current "&PageIndex&"/"&PageCount&" "&
"<a href=\"?page=1"&parmstr&"\">HomePage</a> <a href=\"?page="&(PageIndex-1)&parmstr&"\">PageUp</a> <a href=\"?page="&(PageIndex+1)&parmstr&"\">NextPage</a> <a href=\"?page="&PageCount&parmstr&"\">LastPage</a>"
return strpager
}
学帮资源铺
2012-01-12 · 超过18用户采纳过TA的回答
知道答主
回答量:67
采纳率:0%
帮助的人:58.4万
展开全部
手头没有VB IDE,没法测试,就简单翻译一下哈,VB6的

Public Function engShowPager(parms() As String) As String
Dim parmstr As String
parmstr = vbNullString
Dim i As Integer
For i = 0 To UBound(parms) - 1
Dim parmName As String
parmName = parms(i)
Dim parmValue As String
parmValue = Request.QueryString(parmName)
If parmValue <> "" Then
If parmstr = vbNullString Then
parmstr = "&" & parmName & "=" & parmValue
Else
parmstr = parmstr & "&" & parmName & "=" & parmValue
End If
End If
Next
Dim strpager As String
strpager = " " & RecordCount & " records Current " & PageIndex & "/" & PageCount & " " & "<a href=""?page=1" & parmstr & """>HomePage</a> <a href=""?page=" & (PageIndex - 1) & parmstr & """>PageUp</a> <a href=""?page=" & (PageIndex + 1) & parmstr & """>NextPage</a> <a href=""?page=" & PageCount & parmstr & """>LastPage</a>"
engShowPager = strpager
End Function
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式