在VB中使用C#中的WriteHtmlResponse方法 [英] Use of WriteHtmlResponse method in C# from VB

查看:101
本文介绍了在VB中使用C#中的WriteHtmlResponse方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All



我需要下面列出的方法的解决方案是C#......正在将VB代码翻译成C#



以下是我的VB代码



  SELECT   CASE 请求(  output
CASE xml
rs。读取()
WriteXMLResponse(rs)

CASE excel
WriteExcelResponse(rs)

CASE label
WriteLabelResponse(rs)

CASE html
WriteHtmlResponse(rs)

CASE ELSE
END SELECT





这是我的C#代码



  switch (请求[  输出])
{
case xml
rs.Read();
WriteXMLResponse( ref rs);

break ;
case excel

WriteExcelResponse( ref rs);

break ;
case labels
WriteLabelResponse( ref rs);
break ;

case html
WriteHtmlResponse( ref rs);

break ;
默认
break ;
}





错误:

WriteExcelResponse(ref rs);

WriteLabelResponse(ref rs);

WriteHtmlResponse(ref rs);



当前上下文中不存在名称WriteExcelResponse。

当前上下文中不存在名称'WriteLabelResponse'。

当前上下文中不存在名称'WriteHtmlResponse'。



你们都被要求帮我解决一下

解决方案

这只是意味着你们还必须翻译这三个函数。

这些功能不是系统功能。它们必须是c#代码中的自定义方法。



尝试右键单击方法名称,然后从上下文菜单中单击转到定义。然后,您必须先将这些方法写入VB函数,然后才能调用它们。



另外,请看一下:http://converter.telerik.com/ [ ^ ]

将简单函数从c#转换为vb并返回

非常方便

Hello All

I need solution for below listed methods is C#......As am translating VB code to C#

Below is my VB Code

SELECT CASE Request("output")
           CASE "xml"
               rs.Read()
               WriteXMLResponse(rs)

           CASE "excel"
               WriteExcelResponse(rs)

           CASE "labels"
               WriteLabelResponse(rs)

           CASE "html"
               WriteHtmlResponse(rs)

           CASE ELSE
        END SELECT



Here is my C# code

switch (Request["output"])
      {
          case "xml":
              rs.Read();
              WriteXMLResponse(ref rs);

              break;
          case "excel":

              WriteExcelResponse(ref rs);

              break;
          case "labels":
              WriteLabelResponse(ref rs);
              break;

          case "html":
              WriteHtmlResponse(ref rs);

              break;
          default:
              break;
      }



Error:
WriteExcelResponse(ref rs);
WriteLabelResponse(ref rs);
WriteHtmlResponse(ref rs);

The name 'WriteExcelResponse' does not exist in current context.
The name 'WriteLabelResponse' does not exist in current context.
The name 'WriteHtmlResponse' does not exist in current context.

You all are requested to help me to sort it out

解决方案

That simply means that you have to translate those three functions also.


The functions are not system functions. They must be custom methods in your c# code somewhere.

Try right-clicking the method name and click "go to definition" from the context menu. You will then have to write these methods into VB functions before you can call them.

Also, take a look at this: http://converter.telerik.com/[^]
It's handy for converting simple functions from c# to vb and back


这篇关于在VB中使用C#中的WriteHtmlResponse方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆