.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;
} 展开
{
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;
} 展开
2个回答
展开全部
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
}
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
}
展开全部
手头没有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
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
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询