com_typedisplay.asmx.cs
来自「ASP.NET的一些开发实例,有论坛管理系统等」· CS 代码 · 共 106 行
CS
106 行
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
namespace ERPWebService.BdStudioSoft
{
/// <summary>
/// COM_TypeDisplay 的摘要说明。
/// </summary>
public class COM_TypeDisplay : System.Web.Services.WebService
{
public COM_TypeDisplay()
{
//CODEGEN:该调用是 ASP.NET Web 服务设计器所必需的
InitializeComponent();
}
#region Component Designer generated code
//Web 服务设计器所必需的
private IContainer components = null;
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
#endregion
// WEB 服务示例
// HelloWorld() 示例服务返回字符串 Hello World
// 若要生成,请取消注释下列行,然后保存并生成项目
// 若要测试此 Web 服务,请按 F5 键
// [WebMethod]
// public string HelloWorld()
// {
// return "Hello World";
// }
private string[] strRoleType = {"技术部分","资料部分","沟通部分"};
private string[] strSchemaType = {"项目角色","管理角色"};
private string[] strFileType = {"项目文档","技术文档"};
private DataSet DsType(string[] strType)
{
DataTable dt = new DataTable();
DataSet ds = new DataSet();
dt.Columns.Add(new DataColumn("t_num",typeof(string)));
dt.Columns.Add(new DataColumn("t_name",typeof(string)));
if (strType.Length >0)
{
for (int i=0;i<strType.Length;i++)
{
DataRow dr = dt.NewRow();
dr["t_num"] = i+1;
dr["t_name"] = strType[i];
dt.Rows.Add(dr);
}
ds.Tables.Add(dt);
}
return ds;
}
[WebMethod]
public DataSet RoleTypeDisplay()
{
DataSet ds = this.DsType(strRoleType);
return ds ;
}
[WebMethod]
public DataSet SchemaTypeDisplay()
{
DataSet ds = this.DsType(strSchemaType);
return ds ;
}
[WebMethod]
public DataSet FileTypeDisplay()
{
DataSet ds = this.DsType(strFileType);
return ds ;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?