哪位大侠帮我把这段vb代码翻译成c#的?

dlwhl 2014-12-31 03:18:27
Public Function plugin(aaa As String) As Boolean

If MsgBox("aaaa", vbYesNo) = vbYes Then
plugin = True
aaa = ""
Else
plugin = False
aaa = "a"
End If


End Function
...全文
95 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
exception92 2014-12-31
  • 打赏
  • 举报
回复

 public bool plugin(string aaa)
        {
            if (MessageBox.Show(aaa, "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes)
            {
                aaa = "";
                return true;
            }
            else
            {
                aaa = "a";
                return false;
            }
        }
於黾 2014-12-31
  • 打赏
  • 举报
回复
手敲的,有些类名可能有点问题,比如MessageBoxButton和MessageBoxIcon不太确定.自己敲代码的时候找找类似的
shawn_yang 2014-12-31
  • 打赏
  • 举报
回复
public Boolean plugin(string aaa) { if (MessageBox.Show("ok?", "Confirm Message",MessageBoxButtons.OKCancel,MessageBoxIcon.Question) == DialogResult.OK) { plugin = True; aaa = ""; } else { plugin = False; aaa = "a"; } }
bdmh 2014-12-31
  • 打赏
  • 举报
回复
这有什么东西啊,就一个MsgBox,改成MessageBox.Show
於黾 2014-12-31
  • 打赏
  • 举报
回复
public bool plugin(ref string aaa) { if(MessageBox.Show("aaaa","标题",MessageBoxButton.YesNo,MessageBoxIcon.Question)==DialogResult.Yes) { aaa=""; return true; } else { aaa="a"; return false } }

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧