当前位置: 首页 > news >正文

网站结构 网站内容建设营销策划方案的内容

网站结构 网站内容建设,营销策划方案的内容,怎么开发手机网页,哪个网站可以做魔方图片大全本文内容 使用 C# 索引器实现 C# 的 is 和 as 关键字实现 C# 的 lock 关键字 本节中的主题介绍如何在 Visual C 中创建程序集#xff0c;这些程序集使用或提供以 C# 或 Visual Basic 编写的程序集的功能。 1、使用 C# 索引器 Visual C 不包含索引器#xff1b;它具有索引…本文内容 使用 C# 索引器实现 C# 的 is 和 as 关键字实现 C# 的 lock 关键字 本节中的主题介绍如何在 Visual C 中创建程序集这些程序集使用或提供以 C# 或 Visual Basic 编写的程序集的功能。 1、使用 C# 索引器 Visual C 不包含索引器它具有索引属性。 若要使用 C# 索引器请访问索引器就像它是索引属性一样。 示例 以下 C# 程序定义索引器。 // consume_cs_indexers.cs // compile with: /target:library using System; public class IndexerClass {private int [] myArray new int[100];public int this [int index] { // Indexer declarationget {// Check the index limits.if (index 0 || index 100)return 0;elsereturn myArray[index];}set {if (!(index 0 || index 100))myArray[index] value;}} } /* // code to consume the indexer public class MainClass {public static void Main() {IndexerClass b new IndexerClass();// Call indexer to initialize elements 3 and 5b[3] 256;b[5] 1024;for (int i 0 ; i 10 ; i)Console.WriteLine(Element #{0} {1}, i, b[i]);} } */此 C/CLI 程序使用索引器。 // consume_cs_indexers_2.cpp // compile with: /clr #using consume_cs_indexers.dll using namespace System;int main() {IndexerClass ^ ic gcnew IndexerClass;ic-default[0] 21;for (int i 0 ; i 10 ; i)Console::WriteLine(Element #{0} {1}, i, ic-default[i]); }此示例产生以下输出 Element #0 21 Element #1 0 Element #2 0 Element #3 0 Element #4 0 Element #5 0 Element #6 0 Element #7 0 Element #8 0 Element #9 0 Element #10 02、实现 C# 的 is 和 as 关键字 本主题演示如何在 Visual C 中实现 C# 的 is 和 as 关键字的功能。 示例 // CS_is_as.cpp // compile with: /clr using namespace System;interface class I { public:void F(); };ref struct C : public I {virtual void F( void ) { } };template class T, class U Boolean isinst(U u) {return dynamic_cast T (u) ! nullptr; }int main() {C ^ c gcnew C();I ^ i safe_cast I ^ (c); // is (maps to castclass in IL)I ^ ii dynamic_cast I ^ (c); // as (maps to isinst in IL)// simulate as:Object ^ o f;if ( isinst String ^ (o) )Console::WriteLine(o is a string); }输出结果 o is a string3、实现 C# 的 lock 关键字 本主题演示如何在 Visual C 中实现 C# lock 关键字。 示例 // CS_lock_in_CPP.cpp // compile with: /clr using namespace System::Threading; ref class Lock {Object^ m_pObject; public:Lock( Object ^ pObject ) : m_pObject( pObject ) {Monitor::Enter( m_pObject );}~Lock() {Monitor::Exit( m_pObject );} };ref struct LockHelper {void DoSomething(); };void LockHelper::DoSomething() {// Note: Reference type with stack allocation semantics to provide// deterministic finalizationLock lock( this );// LockHelper instance is locked }int main() {LockHelper lockHelper;lockHelper.DoSomething();return 0; }
http://www.hkea.cn/news/14273122/

相关文章:

  • 成都家居网站建设长春网站建设 4435
  • 中小企业服务中心网站建设自适应网站如何做移动适配
  • 现今网站开发的主流框架古镇 网站建设
  • 湖北建设厅政务网站建设网站需要的ftp资源
  • 宣传网站建设背景免费企业电话名录
  • 亚马逊网站建设分析网站建设合同不给版权
  • 民治制作网站做网站公司流程
  • 广西建设职业学院技术教务系统网站东莞微信网站建设更好
  • 手机号交易网站源码网页qq登录首页
  • 网页模板免费网址seo搜索优化是什么
  • 自己制作免费网站网站制作是那个
  • 厦门网站做的比较好网站开发 工期安排
  • 厦门哪些做鲜花的网站南昌seo网络
  • 南开区网站建设如何下载网站模板
  • 潍坊网站建设自助建站平台wordpress 如何添加关键词
  • 中国住房和城乡建设部网站公文seo技术培训南阳
  • 小城镇建设网站参考文献建站步骤图
  • 专业网站网站设计东莞头条最近15天新闻
  • 做网站专业的公司贩卖做网站资料
  • 南昌企业网站设计建设制作网站空间一般有多大
  • 平顶山市哪里有做网站的移投界seo
  • 备案 填写网站信息大连企业网站排名优化
  • 企业网站建设的参考文献app应用开发在哪里找
  • 温州人才网站开发wordpress企业网站建设
  • php网站开发需要学什么做企业官网需要什么手续
  • 长安外贸网站建设wordpress共用数据库吗
  • 网站开发需求大厅wordpress中文tag插件
  • 网站主机托管明星网页制作模板
  • 网站优化软件排名器中文搜索引擎排行榜
  • 网站seo李守洪排名大师建立免费个人网站