在c#中调出对话框实现方法
方法一:
定义一个类
1
using System;
2
3
namespace GYYW.DA.GYGL
4
{
5
/// <summary>
6
/// Command 的摘要说明。
7
/// </summary>
8
public class Message
9
{
10
public Message()
11
{
12
13
//
14
// TODO: 在此处添加构造函数逻辑
15
//
16
}
17
public string Sh(string str)
18
{
19
return string.Format("<script language={1}javascript{1}>alert({1}{0}{1});</script>",str,"\"");
20
21
}
22
}
23
}
24
25
在.cs中调用2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
先在前台定一个label 并隐藏。
1
string s="ok";
2
GYYW.DA.GYGL.Message MS =new Message();
3
myLabel.Visible=true;
4
myLabel.Text=MS.Sh(s);
string s="ok";2
GYYW.DA.GYGL.Message MS =new Message(); 3
myLabel.Visible=true;4
myLabel.Text=MS.Sh(s);
浙公网安备 33010602011771号