栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > asp

webapi中如何使用依赖注入

asp 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

webapi中如何使用依赖注入

本篇将要和大家分享的是webapi中如何使用依赖注入,依赖注入这个东西在接口中常用,实际工作中也用的比较频繁,因此这里分享两种在api中依赖注入的方式Ninject和Unity;由于快过年这段时间打算了解下vue.js,所以后面对webapi的分享文章可能会慢点更新,希望支持的朋友们多多谅解,毕竟只有不断充电学习,才能更好的适应it行业吧;本章内容希望大家喜欢,也希望各位多多扫码支持和推荐谢谢:

» Task并行任务抓取博客园首页信息

» IOC框架Ninject的使用

» IOC框架Unity的使用

下面一步一个脚印的来分享:

» Task并行任务抓取博客园首页信息

首先,咋们需要创建一个博客信息实体类 MoBlog ,实体类代码如下:

public class MoBlog
 {
  public MoBlog() { }
  /// 
  /// 作者昵称
  /// 
  public string NickName { get; set; }
  /// 
  /// 标题
  /// 
  public string Title { get; set; }
  /// 
  ///该篇文字地址
  /// 
  public string Url { get; set; }
  /// 
  /// 描述
  /// 
  public string Des { get; set; }
  /// 
  /// 头像图片地址
  /// 
  public string HeadUrl { get; set; }
  /// 
  /// 博客地址
  /// 
  public string BlogUrl { get; set; }
  /// 
  /// 点赞次数
  /// 
  public int ZanNum { get; set; }
  /// 
  /// 阅读次数
  /// 
  public int ReadNum { get; set; }
  /// 
  /// 评论次数
  /// 
  public int CommiteNum { get; set; }
  /// 
  /// 创建时间
  /// 
  public DateTime CreateTime { get; set; }
 }

然后,需要创建一个接口 IBlogsReposity ,并且定义一个如下代码的方法:

public interface IBlogsReposity
 {
  /// 
  /// 获取博客信息
  /// 
  /// 
  /// 
  Task> GetBlogs(int nTask);
 }

注意这里定义的返回类型是Task,主要作用是async异步返回博客信息,并且方便使用并行方式抓取不同页数的数据,因此这里传递了一个int类型的参数nTask(表示任务数量);好了咋们来一起看下具体实现接口的 BoKeYuan 类里面的代码:

public class BoKeYuan : IBlogsReposity
 {
  public async Task> GetBlogs(int nTask)
  {
   var blogs = new List();
   try
   {
    //开启nTask个任务,读取前nTask页信息
    Task>[] tasks = new Task>[nTask];
    for (int i = 1; i <= tasks.Length; i++)
    {
     tasks[i - 1] = await Task.Factory.StartNew>>((page) =>
      {
return GetBlogsByPage(Convert.ToInt32(page));
      }, i);
    }
    //30s等待
    Task.WaitAll(tasks, TimeSpan.FromSeconds(30));
    foreach (var item in tasks.Where(b => b.IsCompleted))
    {
     blogs.AddRange(item.Result);
    }
   }
   catch (Exception ex)
   {
   }
   return blogs.OrderByDescending(b => b.CreateTime);
  }
  /// 
  /// 
  /// 
  /// 页数
  /// 
  async Task> GetBlogsByPage(int nPage)
  {
   var blogs = new List();
   try
   {
    var strBlogs = string.Empty;
    using (HttpClient client = new HttpClient())
    {
     strBlogs = await client.GetStringAsync("http://www.cnblogs.com/sitehome/p/" + nPage);
    }
    if (string.IsNullOrWhiteSpace(strBlogs)) { return blogs; }
    var matches = Regex.Matches(strBlogs, "diggnum"[^>]+>(?\d+)[^:]+(?http[^"]+)[^>]+>(?[^<]+)<\/a>[^=]+=[^=]+="(?<hurl>http://(\w|\.|\/)+)[^>]+>[^\/]+\/\/(?<hphoto>[^"]+)[^<]+<\/a>(?<bdes>[^<]+)[^"]+[^=]+=[^>]+>(?<hname>[^<]+)[^2]+(?<bcreatetime>[^<]+)[^\(]+\((?<bcomment>\d+)[^\(]+\((?<bread>\d+)");
    if (matches.Count <= 0) { return blogs; }
    foreach (Match item in matches)
    {
     blogs.Add(new MoBlog
     {
      Title = item.Groups["title"].Value.Trim(),
      NickName = item.Groups["hname"].Value.Trim(),
      Des = item.Groups["bdes"].Value.Trim(),
      ZanNum = Convert.ToInt32(item.Groups["hzan"].Value.Trim()),
      ReadNum = Convert.ToInt32(item.Groups["bread"].Value.Trim()),
      CommiteNum = Convert.ToInt32(item.Groups["bcomment"].Value.Trim()),
      CreateTime = Convert.ToDateTime(item.Groups["bcreatetime"].Value.Trim()),
      HeadUrl = "http://" + item.Groups["hphoto"].Value.Trim(),
      BlogUrl = item.Groups["hurl"].Value.Trim(),
      Url = item.Groups["burl"].Value.Trim(),
     });
    }
   }
   catch (Exception ex)
   {
   }
   return blogs;
  }
 }

</pre>

<p>代码分析:</p>
<p>1. Task<IEnumerable<MoBlog>>[] tasks = new Task<IEnumerable<MoBlog>>[nTask]作为并行任务的容器;</p>
<p>2. Task.Factory.StartNew创建对应的任务</p>
<p>3. Task.WaitAll(tasks, TimeSpan.FromSeconds(30));等待容器里面任务完成30秒后超时</p>
<p>4. 最后通过把item.Result任务结果添加到集合中,返回我们需要的数据</p>
<p>这里解析博客内容信息用的正则表达式,这种方式在抓取一定内容上很方便;群里面有些朋友对正则有点反感,刚接触的时候觉得挺不好写的,所以一般都采用更复杂或者其他的解析方式来获取想要的内容,这里提出来主要是和这些朋友分享下正则获取数据是多么方便,很有必要学习下并且掌握常规的用法,这也是一种苦尽甘来的体验吧哈哈;</p>
<p>好了咋们创建一个webapi项目取名为 Stage.Api ,使用她自动生成的 ValuesController 文件里面的Get方法接口来调用咋们上面实现的博客抓取方法,代码如下:</p>

<pre class="brush:csharp;">
// GET api/values
  public async Task<IEnumerable<MoBlog>> Get(int task = 6)
  {
   task = task <= 0 ? 6 : task;
   task = task > 50 ? 50 : task;
   IBlogsReposity _reposity = new BoKeYuan();
   return await _reposity.GetBlogs(task);
  }</pre>

<p>这里使用 IBlogsReposity _reposity = new BoKeYuan(); 来创建和调用具体的实现类,这里贴出一个线上抓取博客首页信息的地址(不要告诉dudu):http://www.lovexins.com:1001/api/values?task=6;咋们来想象一下,如果这个Get方法中还需要调用其他实现了接口 IBlogsReposity 的博客抓取类,那咋们又需要手动new一次来创建对应的对象;倘若除了在 ValuesController.cs 文件中调用了博客数据抓取,其他文件还需要这抓取数据的业务,那么又会不停的new,可能有朋友就会说那弄一个工厂模式怎么样,不错这是可行的一种方式,不过这里还有其他方法能处理这种问题,比如:ioc依赖注入;因此就有了下面的分享内容。</p>
<p><strong>» IOC框架Ninject的使用</strong></p>
<p>首先,我们要使用ninject需要使用nuget下载安装包,这里要注意的是Ninject版本比较多,需要选择合适自己webapi的版本,我这里选择的是:</p>
<p style="text-align: center"></p>
<p>看起来很老了哈哈,不过咋们能用就行,安装起来可能需要点时间,毕竟比较大么也有可能是网络的问题吧;安装完后咋们创建一个自定义类 NinjectResolverScope 并实现接口 IDependencyScope , IDependencyScope 对应的类库是 System.Web.Http.dll (注:由于webapi2项目自动生成时候可能勾选了mvc,mvc框架里面也包含了一个IDependencyScope,所以大家需要注意区分下),好了咋们来直接看下 NinjectResolverScope 实现代码:</p>

<pre class="brush:csharp;">
/// <summary>
 /// 解析
 /// </summary>
 public class NinjectResolverScope : IDependencyScope
 {
  private IResolutionRoot root;
  public NinjectResolverScope() { }
  public NinjectResolverScope(IResolutionRoot root)
  {
   this.root = root;
  }
  public object GetService(Type serviceType)
  {
   try
   {
    return root.TryGet(serviceType);
   }
   catch (Exception ex)
   {
    return null;
   }
  }
  public IEnumerable<object> GetServices(Type serviceType)
  {
   try
   {
    return this.root.GetAll(serviceType);
   }
   catch (Exception ex)
   {
    return new List<object>();
   }
  }
  public void Dispose()
  {
   var disposable = this.root as IDisposable;
   if (disposable != null)
    disposable.Dispose();

   this.root = null;
  }
 }</pre>

<p>这里要注意的是GetService和GetServices方法必须使用  try...catch() 包住,经过多方调试和测试,这里面会执行除手动bind绑定外的依赖,还会执行几个其他非手动绑定的实例对象,这里使用try避免抛异常影响到程序(其实咋们可以在这里用代码过滤掉非手动绑定的几个实例);这里也简单说下这个 NinjectResolverScope 中方法执行的先后顺序:GetService=》GetServices=》Dispose,GetService主要用来获取依赖注入对象的实例;好了到这里咋们还需要一个自定义容器类 NinjectResolverContainer ,该类继承自上面的 NinjectResolverScope 和实现 IDependencyResolver 接口(其实细心的朋友能发现这个 IDependencyResolver 同样也继承了 IDependencyScope ),具体代码如下:</p>

<pre class="brush:csharp;">
public class NinjectResolverContainer : NinjectResolverScope, IDependencyResolver
 {
  private IKernel kernel;
  public static NinjectResolverContainer Current
  {
   get
   {
    var container = new NinjectResolverContainer();
    //初始化
    container.Initing();
    //绑定
    container.Binding();
    return container;
   }
  }
  /// <summary>
  /// 初始化kernel
  /// </summary>
  void Initing()
  {
   kernel = new StandardKernel();
  }
  /// <summary>
  /// 绑定
  /// </summary>
  void Binding()
  {
   kernel.Bind<IBlogsReposity>().To<BoKeYuan>();
  }
  /// <summary>
  /// 开始执行
  /// </summary>
  /// <returns></returns>
  public IDependencyScope BeginScope()
  {
   return new NinjectResolverScope(this.kernel.BeginBlock());
  }
 }</pre>

<p>这里能够看到 IKernel kernel = new StandardKernel(); 这代码,她们引用都来源于我们安装的Ninject包,通过调用初始化Initing()后,我们需要在Binding()方法中手动绑定我们对应需要依赖注入的实例,Ninject绑定方式有很多种这里我用的格式是: kernel.Bind<接口>().To<实现类>(); 如此简单就实现了依赖注入,每次我们需要添加不同的依赖项的时候只需要在这个Binding()中使用Bind<接口>.To<接口实现类>()即可绑定成功;好了为了验证咋们测试成功性,我们需要在apiController中使用这个依赖关系,这里我使用构造函数依赖注入的方式:</p>

<pre class="brush:csharp;">
private readonly IBlogsReposity _reposity
  public ValuesController(IBlogsReposity reposity)
  {
   _reposity = reposity;
  }
  // GET api/values 
  public async Task<IEnumerable<MoBlog>> Get(int task = 6)
  {
   task = task <= 0 ? 6 : task;
   task = task > 50 ? 50 : task;
   return await _reposity.GetBlogs(task);
  }
</pre>

<p>代码如上所示,我们运行下程序看下效果:</p>
<p style="text-align: center"></p>
<p>这个时候提示了个错误“没有默认构造函数”;我们刚才使用的构造函数是带有参数的,而自定义继承的 ApiController 中有一个无参数的构造函数,根据错误提示内容完全无解;不用担心,解决这个问题只需要在 WebApiConfig.cs 中Register方法中增加如下代码:</p>

<pre class="brush:csharp;">
 //Ninject ioc
 config.DependencyResolver = NinjectResolverContainer.Current;</pre>

<p>这句代码意思就是让程序执行上面咋们创建的容器 NinjectResolverContainer ,这样才能执行到我能刚才写的ioc程序,才能实现依赖注入;值得注意的是 config.DependencyResolver 是webapi自带的提供的,mvc项目也有同样提供了 DependencyResolver  给我们使用方便做依赖解析;好了这次我们在运行项目可以得到如图效果:</p>
<p style="text-align: center"></p>
<p><strong>» IOC框架Unity的使用</strong></p>
<p>首先,安装Unity和Unity.WebAPI的nuget包,我这里的版本是:</p>
<p style="text-align: center"></p>
<p>我们再同样创建个自定义容器类 UnityResolverContainer ,实现接口 IDependencyResolver (这里和上面Ninject一样);然后这里贴上具体使用Unity实现的方法:</p>

<pre class="brush:csharp;">
public class UnityResolverContainer : IDependencyResolver
 {
  private IUnityContainer _container;
  public UnityResolverContainer(IUnityContainer container)
  {
   this._container = container;
  }
  public IDependencyScope BeginScope()
  {
   var scopeContainer = this._container.CreateChildContainer();
   return new UnityResolverContainer(scopeContainer);
  }
  /// <summary>
  /// 获取对应类型的实例,注意try...catch...不能够少
  /// </summary>
  /// <param name="serviceType"></param>
  /// <returns></returns>
  public object GetService(Type serviceType)
  {
   try
   {
    //if (!this._container.IsRegistered(serviceType)) { return null; }
    return this._container.Resolve(serviceType);
   }
   catch
   {
    return null;
   }
  }
  public IEnumerable<object> GetServices(Type serviceType)
  {
   try
   {
    return this._container.ResolveAll(serviceType);
   }
   catch
   {
    return new List<object>();
   }
  }
  public void Dispose()
  {
   if (_container != null)
   {
    this._container.Dispose();
    this._container = null;
   }
  }
 }
</pre>

<p> 这里和使用Ninject的方式很类似,需要注意的是我们在安装Unity包的时候会自动在 WebApiConfig.cs 增加如下代码:</p>

<pre class="brush:csharp;">
 //Unity ioc
UnityConfig.RegisterComponents();</pre>

<p>然后同时在 App_Start 文件夹中增加 UnityConfig.cs 文件,我们打开此文件能看到一些自动生成的代码,这里我们就可以注册绑定我们的依赖,代码如:</p>

<pre class="brush:csharp;">
public static class UnityConfig
 {
  public static void RegisterComponents()
  {
   var container = new UnityContainer();
   container.RegisterType<IBlogsReposity, BoKeYuan>();
   // var lifeTimeOption = new ContainerControlledLifetimeManager();
   //container.RegisterInstance<IBlogsReposity>(new BoKeYuan(), lifeTimeOption);
   GlobalConfiguration.Configuration.DependencyResolver = new UnityResolverContainer(container);
  }
 }</pre>

<p>这里展示了两种注册依赖的方式: container.RegisterType<IBlogsReposity, BoKeYuan>(); 和 container.RegisterInstance<IBlogsReposity>(new BoKeYuan(), lifeTimeOption); ,当然还有其他的扩展方法这里就不举例了;最后一句代码: GlobalConfiguration.Configuration.DependencyResolver = new UnityResolverContainer(container); 和我们之前Ninject代码一样,只是换了一个地方和实例化写法方式而已,各位可以仔细对比下;其实 UnityConfig.cs 里面的内容都可以移到 WebApiConfig.cs 中去,unity自动分开应该是考虑到代码内容分块来管理吧,好了同样我们使用自定义的 ValuesController 的构造函数来添加依赖:</p>

<pre class="brush:csharp;">
public class ValuesController : ApiController
 {
  private readonly IBlogsReposity _reposity;
  public ValuesController(IBlogsReposity reposity)
  {
   _reposity = reposity;
  }
  // GET api/values 
  public async Task<IEnumerable<MoBlog>> Get(int task = 6)
  {
   task = task <= 0 ? 6 : task;
   task = task > 50 ? 50 : task;
   return await _reposity.GetBlogs(task);
  }
}
</pre>

<p>从代码上来看,这里面Ninject和Unity的注入方式没有差异,这样能就让我们开发程序的时候两种注入方式可以随便切换了,最后来我这里提供一个使用这个webapi获取数据绑定到页面上的效果:</p>
<p style="text-align: center"></p>
<p>以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持考高分网!<br />
</p></div>
</div>
<div style="clear: both;"></div>
<div class="author-info fl">
<div><span class="gray">转载请注明:</span>文章转载自 <a href="https://www.mshxw.com/" class="blue">www.mshxw.com</a></div>
<div><span class="gray">本文地址:</span><a href="https://www.mshxw.com/it/55784.html" class="blue">https://www.mshxw.com/it/55784.html</a></div>
</div>
<div class="prev fl">
<p>   <a style='text-align:left;' class='center-block text-center glyphicon glyphicon-collapse-down' href="https://www.mshxw.com/it/55824.html">上一篇  ASP.NET webUploader上传大视频文件相关web.config配置</a>
 </p>
<p>   <a style='text-align:left;' class='center-block text-center glyphicon glyphicon-collapse-down' href="https://www.mshxw.com/it/55783.html">下一篇  ASP.NET保存PDF、Word和Excel文件到数据库</a>
  </p>
</div>
<div class="new_tag fl">
</div>
</div>
<div class="new_r fr" style="border-radius:10px;">
<div class="tui fl">
<h3>asp相关栏目本月热门文章</h3>
<ul>
  <li><span>1</span><a href="https://www.mshxw.com/it/1041277.html" title="【Linux驱动开发】设备树详解(二)设备树语法详解">【Linux驱动开发】设备树详解(二)设备树语法详解</a></li>
  <li><span>2</span><a href="https://www.mshxw.com/it/1041273.html" title="别跟客户扯细节">别跟客户扯细节</a></li>
  <li><span>3</span><a href="https://www.mshxw.com/it/1041266.html" title="Springboot+RabbitMQ+ACK机制(生产方确认(全局、局部)、消费方确认)、知识盲区">Springboot+RabbitMQ+ACK机制(生产方确认(全局、局部)、消费方确认)、知识盲区</a></li>
  <li><span>4</span><a href="https://www.mshxw.com/it/1041261.html" title="【Java】对象处理流(ObjectOutputStream和ObjectInputStream)">【Java】对象处理流(ObjectOutputStream和ObjectInputStream)</a></li>
  <li><span>5</span><a href="https://www.mshxw.com/it/1041256.html" title="【分页】常见两种SpringBoot项目中分页技巧">【分页】常见两种SpringBoot项目中分页技巧</a></li>
  <li><span>6</span><a href="https://www.mshxw.com/it/1041299.html" title="一文带你搞懂OAuth2.0">一文带你搞懂OAuth2.0</a></li>
  <li><span>7</span><a href="https://www.mshxw.com/it/1041297.html" title="我要写整个中文互联网界最牛逼的JVM系列教程 | 「JVM与Java体系架构」章节:虚拟机与Java虚拟机介绍">我要写整个中文互联网界最牛逼的JVM系列教程 | 「JVM与Java体系架构」章节:虚拟机与Java虚拟机介绍</a></li>
  <li><span>8</span><a href="https://www.mshxw.com/it/1041296.html" title="【Spring Cloud】新闻头条微服务项目:FreeMarker模板引擎实现文章静态页面生成">【Spring Cloud】新闻头条微服务项目:FreeMarker模板引擎实现文章静态页面生成</a></li>
  <li><span>9</span><a href="https://www.mshxw.com/it/1041294.html" title="JavaSE - 封装、static成员和内部类">JavaSE - 封装、static成员和内部类</a></li>
  <li><span>10</span><a href="https://www.mshxw.com/it/1041291.html" title="树莓派mjpg-streamer实现监控及拍照功能调试">树莓派mjpg-streamer实现监控及拍照功能调试</a></li>
  <li><span>11</span><a href="https://www.mshxw.com/it/1041289.html" title="用c++写一个蓝屏代码">用c++写一个蓝屏代码</a></li>
  <li><span>12</span><a href="https://www.mshxw.com/it/1041285.html" title="从JDK8源码中看ArrayList和LinkedList的区别">从JDK8源码中看ArrayList和LinkedList的区别</a></li>
  <li><span>13</span><a href="https://www.mshxw.com/it/1041281.html" title="idea 1、报错java: 找不到符号 符号: 变量 log 2、转换成Maven项目">idea 1、报错java: 找不到符号 符号: 变量 log 2、转换成Maven项目</a></li>
  <li><span>14</span><a href="https://www.mshxw.com/it/1041282.html" title="在openwrt使用C语言增加ubus接口(包含C uci操作)">在openwrt使用C语言增加ubus接口(包含C uci操作)</a></li>
  <li><span>15</span><a href="https://www.mshxw.com/it/1041278.html" title="Spring 解决循环依赖">Spring 解决循环依赖</a></li>
  <li><span>16</span><a href="https://www.mshxw.com/it/1041275.html" title="SpringMVC——基于MVC架构的Spring框架">SpringMVC——基于MVC架构的Spring框架</a></li>
  <li><span>17</span><a href="https://www.mshxw.com/it/1041272.html" title="Andy‘s First Dictionary C++ STL set应用">Andy‘s First Dictionary C++ STL set应用</a></li>
  <li><span>18</span><a href="https://www.mshxw.com/it/1041271.html" title="动态内存管理">动态内存管理</a></li>
  <li><span>19</span><a href="https://www.mshxw.com/it/1041270.html" title="我的创作纪念日">我的创作纪念日</a></li>
  <li><span>20</span><a href="https://www.mshxw.com/it/1041269.html" title="Docker自定义镜像-Dockerfile">Docker自定义镜像-Dockerfile</a></li>
</ul>
</div>
</div>
</div>
<!-- 公共尾部 -->
<div class="link main">
<div class="link_tit">
<span class="on">热门相关搜索</span>
</div>
<div class="link_tab">
<div class="link_con">
<a href="http://www.mshxw.com/TAG_1/luyouqishezhi.html">路由器设置</a>
<a href="http://www.mshxw.com/TAG_1/mutuopan.html">木托盘</a>
<a href="http://www.mshxw.com/TAG_1/baotamianban.html">宝塔面板</a>
<a href="http://www.mshxw.com/TAG_1/shaoerpython.html">儿童python教程</a>
<a href="http://www.mshxw.com/TAG_1/xinqingdiluo.html">心情低落</a>
<a href="http://www.mshxw.com/TAG_1/pengyouquan.html">朋友圈</a>
<a href="http://www.mshxw.com/TAG_1/vim.html">vim</a>
<a href="http://www.mshxw.com/TAG_1/shuangyiliuxueke.html">双一流学科</a>
<a href="http://www.mshxw.com/TAG_1/zhuanshengben.html">专升本</a>
<a href="http://www.mshxw.com/TAG_1/wodexuexiao.html">我的学校</a>
<a href="http://www.mshxw.com/TAG_1/rijixuexiao.html">日记学校</a>
<a href="http://www.mshxw.com/TAG_1/xidianpeixunxuexiao.html">西点培训学校</a>
<a href="http://www.mshxw.com/TAG_1/qixiuxuexiao.html">汽修学校</a>
<a href="http://www.mshxw.com/TAG_1/qingshu.html">情书</a>
<a href="http://www.mshxw.com/TAG_1/huazhuangxuexiao.html">化妆学校</a>
<a href="http://www.mshxw.com/TAG_1/tagouwuxiao.html">塔沟武校</a>
<a href="http://www.mshxw.com/TAG_1/yixingmuban.html">异形模板</a>
<a href="http://www.mshxw.com/TAG_1/xinandaxuepaiming.html">西南大学排名</a>
<a href="http://www.mshxw.com/TAG_1/zuijingpirenshengduanju.html">最精辟人生短句</a>
<a href="http://www.mshxw.com/TAG_1/6bujiaonizhuihuibeipian.html">6步教你追回被骗的钱</a>
<a href="http://www.mshxw.com/TAG_1/nanchangdaxue985.html">南昌大学排名</a>
<a href="http://www.mshxw.com/TAG_1/qingchaoshierdi.html">清朝十二帝</a>
<a href="http://www.mshxw.com/TAG_1/beijingyinshuaxueyuanpaiming.html">北京印刷学院排名</a>
<a href="http://www.mshxw.com/TAG_1/beifanggongyedaxuepaiming.html">北方工业大学排名</a>
<a href="http://www.mshxw.com/TAG_1/beijinghangkonghangtiandaxuepaiming.html">北京航空航天大学排名</a>
<a href="http://www.mshxw.com/TAG_1/shoudoujingjimaoyidaxuepaiming.html">首都经济贸易大学排名</a>
<a href="http://www.mshxw.com/TAG_1/zhongguochuanmeidaxuepaiming.html">中国传媒大学排名</a>
<a href="http://www.mshxw.com/TAG_1/shoudoushifandaxuepaiming.html">首都师范大学排名</a>
<a href="http://www.mshxw.com/TAG_1/zhongguodezhidaxue(beijing)paiming.html">中国地质大学(北京)排名</a>
<a href="http://www.mshxw.com/TAG_1/beijingxinxikejidaxuepaiming.html">北京信息科技大学排名</a>
<a href="http://www.mshxw.com/TAG_1/zhongyangminzudaxuepaiming.html">中央民族大学排名</a>
<a href="http://www.mshxw.com/TAG_1/beijingwudaoxueyuanpaiming.html">北京舞蹈学院排名</a>
<a href="http://www.mshxw.com/TAG_1/beijingdianyingxueyuanpaiming.html">北京电影学院排名</a>
<a href="http://www.mshxw.com/TAG_1/zhongguohuquxueyuanpaiming.html">中国戏曲学院排名</a>
<a href="http://www.mshxw.com/TAG_1/hebeizhengfazhiyexueyuanpaiming.html">河北政法职业学院排名</a>
<a href="http://www.mshxw.com/TAG_1/hebeijingmaodaxuepaiming.html">河北经贸大学排名</a>
<a href="http://www.mshxw.com/TAG_1/tianjinzhongdeyingyongjishudaxuepaiming.html">天津中德应用技术大学排名</a>
<a href="http://www.mshxw.com/TAG_1/tianjinyixuegaodengzhuankexuejiaopaiming.html">天津医学高等专科学校排名</a>
<a href="http://www.mshxw.com/TAG_1/tianjinmeishuxueyuanpaiming.html">天津美术学院排名</a>
<a href="http://www.mshxw.com/TAG_1/tianjinyinlexueyuanpaiming.html">天津音乐学院排名</a>
<a href="http://www.mshxw.com/TAG_1/tianjingongyedaxuepaiming.html">天津工业大学排名</a>
<a href="http://www.mshxw.com/TAG_1/beijinggongyedaxuegengdanxueyuanpaiming.html">北京工业大学耿丹学院排名</a>
<a href="http://www.mshxw.com/TAG_1/beijingjingchaxueyuanpaiming.html">北京警察学院排名</a>
<a href="http://www.mshxw.com/TAG_1/tianjinkejidaxuepaiming.html">天津科技大学排名</a>
<a href="http://www.mshxw.com/TAG_1/beijingyoudiandaxue(hongfujiaoou)paiming.html">北京邮电大学(宏福校区)排名</a>
<a href="http://www.mshxw.com/TAG_1/beijingwanglaozhiyexueyuanpaiming.html">北京网络职业学院排名</a>
<a href="http://www.mshxw.com/TAG_1/beijingdaxueyixuebupaiming.html">北京大学医学部排名</a>
<a href="http://www.mshxw.com/TAG_1/hebeikejidaxuepaiming.html">河北科技大学排名</a>
<a href="http://www.mshxw.com/TAG_1/hebeidezhidaxuepaiming.html">河北地质大学排名</a>
<a href="http://www.mshxw.com/TAG_1/hebeitiyoxueyuanpaiming.html">河北体育学院排名</a>
</div>
</div>
</div>
<div class="footer">
<div class="dl_con">
<div class="width1200">
<dl>
<dt>学习工具</dt>
<dd><a href="https://www.mshxw.com/tools/algebra/" title="代数计算器">代数计算器</a></dd>
<dd><a href="https://www.mshxw.com/tools/trigonometry/" title="三角函数计算器">三角函数</a></dd>
<dd><a href="https://www.mshxw.com/tools/analytical/" title="解析几何">解析几何</a></dd>
<dd><a href="https://www.mshxw.com/tools/solidgeometry/" title="立体几何">立体几何</a></dd>
</dl>
<dl>
<dt>知识解答</dt>
<dd><a href="https://www.mshxw.com/ask/1033/"  title="教育知识">教育知识</a></dd>
<dd><a href="https://www.mshxw.com/ask/1180/"  title="百科知识">百科知识</a></dd>
<dd><a href="https://www.mshxw.com/ask/1155/"  title="生活知识">生活知识</a></dd>
<dd><a class="https://www.mshxw.com/ask/1199/"  title="常识知识">常识知识</a></dd>
</dl>
<dl>
<dt>写作必备</dt>
<dd><a href="https://www.mshxw.com/zuowen/1128/" title="作文大全">作文大全</a></dd>
<dd><a href="https://www.mshxw.com/zuowen/1130/" title="作文素材">作文素材</a></dd>
<dd><a href="https://www.mshxw.com/zuowen/1132/" title="句子大全">句子大全</a></dd>

<dd><a href="https://www.mshxw.com/zuowen/1154/" title="实用范文">实用范文</a></dd>
</dl>
<dl class="mr0">
<dt>关于我们</dt>
<dd><a href="https://www.mshxw.com/about/index.html" title="关于我们" rel="nofollow">关于我们</a></dd>
<dd><a href="https://www.mshxw.com/about/contact.html" title="联系我们" rel="nofollow">联系我们</a></dd>
<dd><a href="https://www.mshxw.com/sitemap/" title="网站地图">网站地图</a></dd>
</dl>
<div class="dl_ewm">
<div class="wx"> <img src="https://www.mshxw.com/skin/sinaskin//kaotop/picture/gzh.jpg" alt="交流群">
<p>名师互学网交流群</p>
</div>
<div class="wx"><img src="https://www.mshxw.com/skin/sinaskin//kaotop/picture/weixin.jpg" alt="名师互学网客服">
<p>名师互学网客服</p>
</div>
</div>
</div>
</div>
<div class="copyright">
<p>名师互学网 版权所有 (c)2021-2022      ICP备案号:<a href="https://beian.miit.gov.cn" rel="nofollow">晋ICP备2021003244-6号</a>
 </p>
</div>
</div>
<!-- 手机端 -->
<div class="m_foot_top">
<img src="https://www.mshxw.com/foot.gif" width="192" height="27" alt="我们一直用心在做"><br/>
<a href="https://www.mshxw.com/about/index.html">关于我们</a>
<a href="https://www.mshxw.com/archiver/">文章归档</a>
<a href="https://www.mshxw.com/sitemap">网站地图</a>
<a href="https://www.mshxw.com/about/contact.html">联系我们</a>
<p>版权所有 (c)2021-2022 MSHXW.COM</p>
<p>ICP备案号:<a href="https://beian.miit.gov.cn/" rel="nofollow">晋ICP备2021003244-6号</a></p>
</div>
<div class="to_top" style="display:none;"><img src="https://www.mshxw.com/skin/sinaskin//kaotop/picture/to_top.png"></div>
<!--广告!-->
<script type="text/javascript" src="https://www.mshxw.com/skin/sinaskin//kaotop/js/top.js"></script>
<script src="https://www.mshxw.com/skin/sinaskin//kaotop/js/fixed.js" type="text/javascript"></script>
<!--头条搜索!-->
<script>
(function(){
var el = document.createElement("script");
el.src = "https://lf1-cdn-tos.bytegoofy.com/goofy/ttzz/push.js?018f42187355ee18d1bfcee0487fc91a76ac6319beb05b7dc943033ed22c446d3d72cd14f8a76432df3935ab77ec54f830517b3cb210f7fd334f50ccb772134a";
el.id = "ttzz";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(el, s);
})(window)
</script>
<!--头条搜索结束!-->
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?e05fec1c87ee5ca07f1ce57d093866c4";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
</div>
</div>
<script type="text/javascript">
$(".alert_kf").click(function() {
      mantis.requestChat();
 });
</script>
<script type="text/javascript">
var mySwiper_weixin = new Swiper('.pc_swiper_weixin', {
autoplay: 3000, //可选选项,自动滑动
loop: true,
speed: 1000,
pagination: '.swiper-pagination',
paginationClickable: true,
})
</script>
<script type="text/javascript">
$(function() {
$(window).scroll(function() {
if ($(window).scrollTop() > 100) {
$(".to_top").fadeIn(1000);
} else {
$(".to_top").fadeOut(1000);
}
});
$(".to_top").click(function() {
if ($('html').scrollTop()) {
$('html').animate({
scrollTop: 0
}, 300);
return false;
}
$('body').animate({
scrollTop: 0
}, 300);
return false;
});
});
</script>
</body>
</html>