最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

C#中word導(dǎo)出功能的騷操作詳解

 更新時(shí)間:2021年02月12日 08:33:00   作者:隨風(fēng)去遠(yuǎn)方  
這篇文章主要給大家介紹了關(guān)于C#中word導(dǎo)出功能騷操作的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧

前言

馬上過(guò)牛年了,先祝大家新年好,身體好,心情好?。?!

年前最后寫一篇之前項(xiàng)目開(kāi)發(fā)的一個(gè)功能,自己根據(jù)系統(tǒng)業(yè)務(wù),想到的一個(gè)解決辦法,效率還是不錯(cuò)的,廢話不多說(shuō),開(kāi)整?。?!

需求:

企業(yè)填報(bào)自己的企業(yè)信息到系統(tǒng)中,最后需要將數(shù)據(jù)以給定word模板形式導(dǎo)出,功能簡(jiǎn)單,就是要開(kāi)發(fā)快,趕及

分析:主要費(fèi)時(shí)間的工作是設(shè)計(jì)企業(yè)填報(bào)表單設(shè)計(jì)實(shí)現(xiàn),以及根據(jù)提供的word模板導(dǎo)出數(shù)據(jù)這塊兒,因?yàn)樯婕暗降谋韱伪容^多,一個(gè)表單最少也有差不多150多個(gè)字段,一個(gè)一個(gè)對(duì),頭發(fā)也得一把一把的掉

想到的解決法案:在導(dǎo)出word這個(gè)功能模塊兒,寫一些通用的方法,減少一些工作量。

        word數(shù)據(jù)導(dǎo)出功能,思路就是在word模板中每一個(gè)需要填數(shù)據(jù)的地方命名一個(gè)標(biāo)簽,代碼中找到對(duì)應(yīng)命名的標(biāo)簽,插入數(shù)值

傳統(tǒng)做法,第一步:在word模板中填寫標(biāo)簽 第二步:程序中每個(gè)插入字段數(shù)據(jù)和word模板標(biāo)簽對(duì)應(yīng),最后插值,這樣做有一個(gè)問(wèn)題就是比較耗時(shí)間,而且很容易出錯(cuò)

        我的做法,第一步:給數(shù)據(jù)字段一個(gè)自定義特性,在自定定義特性中寫上對(duì)應(yīng)的標(biāo)簽地址,應(yīng)用反射的方法將數(shù)據(jù)最終插入到word模板中。這樣就省去了第一步在word中寫標(biāo)簽這樣繁雜的操作。這樣做的問(wèn)題就是性能比較差,但是可以忽略不計(jì)

大體思路就這樣,我就單獨(dú)寫一個(gè)demo供大家參考,之后能用就用,重在思路和想法的分享和討論

開(kāi)寫:

新建一個(gè)項(xiàng)目:ExportWordModel

最終項(xiàng)目簡(jiǎn)易結(jié)構(gòu):

將沒(méi)用的東西全部去掉,修改Index.cshtml頁(yè)面成這樣:

@{
 ViewBag.Title = "Home Page";
}
<div class="jumbotron" style="text-align: center">
 @*<h1>ASP.NET</h1>*@
 <input type="button" value="導(dǎo)出" onclick="location.href = '@Url.Action("GetExport","Home")'" />
</div>

在 HomeController 中創(chuàng)建:GetExport

創(chuàng)建一個(gè)類ExportFileOperator(所有的word操作),此類需要繼承Controller,因?yàn)橛蟹祷谾ile操作方法

1、 在GetExport中首先命名一個(gè)導(dǎo)出word標(biāo)題就叫:測(cè)試導(dǎo)出Word文件

string title = "測(cè)試導(dǎo)出Word文件";

創(chuàng)建doc:

 var doc = ExportFileOperator.CreateBuilder("GroupForm.doc");

2、CreateBuilder方法實(shí)現(xiàn)為(此處操作需要Aspose.Word組件,是操作word的,這個(gè)需要大家自己去找一下,或者網(wǎng)上找個(gè)破解的):

private static string _tempPath = AppDomain.CurrentDomain.BaseDirectory;
public static (Document doc, DocumentBuilder builder) CreateBuilder(string tempFileName)
{
 string tempPath = $"{_tempPath}{tempFileName}";
 Document doc = new Document(tempPath);
 return (doc, new DocumentBuilder(doc));
}

3、插入標(biāo)題(需要在word中寫一個(gè)標(biāo)簽,作為標(biāo)題插入的地址):

最終可以顯示結(jié)果為這樣:

方法:

ExportFileOperator.InsertTitle(ref doc.Item2, title);//插入標(biāo)題

public static void InsertTitle(ref DocumentBuilder builder, string fileName, string tempBookMarkName = "title")
{
  builder.MoveToBookmark(tempBookMarkName);
  builder.Write(fileName);
}

4、根據(jù)業(yè)務(wù)實(shí)體,將實(shí)體數(shù)據(jù)寫入到word中,也是核心所在

首先命名一個(gè)數(shù)據(jù)類:

public class EnterpriseEntity
 {
   #region 實(shí)體成員
  /// <summary>
  /// id
  /// </summary>
  public string id { get; set; }
  /// <summary>
  /// 團(tuán)隊(duì)名
  /// </summary>
  [Description("企業(yè)名稱")]
  public string v1 { get; set; }
  /// <summary>
  /// 統(tǒng)一社會(huì)信用代碼
  /// </summary>
  [Description("統(tǒng)一社會(huì)信用代碼")]
  public string v3 { get; set; }
  /// <summary>
  /// 成立日期
  /// </summary>
  [Description("成立日期")]
  public string v4 { get; set; }

  /// <summary>
  /// 參賽行業(yè)領(lǐng)域
  /// </summary>
  [Description("參賽行業(yè)領(lǐng)域")]
  public string v5 { get; set; }
  /// <summary>
  /// 行政區(qū)域
  /// </summary>
  [Description("行政區(qū)域")]
  public string v6 { get; set; }
  /// <summary>
  /// 是否屬于國(guó)家高新區(qū)內(nèi)的企業(yè)
  /// </summary>
  [Description("屬于國(guó)家高新區(qū)內(nèi)的企業(yè)")]
  public string v7 { get; set; }
  /// <summary>
  /// 是否屬于國(guó)家級(jí)經(jīng)濟(jì)開(kāi)發(fā)區(qū)內(nèi)的企業(yè)
  /// </summary>
  [Description("屬于國(guó)家級(jí)經(jīng)濟(jì)開(kāi)發(fā)區(qū)內(nèi)的企業(yè)")]
  public string v9 { get; set; }
  /// <summary>
  /// 是否屬于國(guó)家級(jí)科技企業(yè)孵化器內(nèi)的企業(yè)
  /// </summary>
  [Description("屬于國(guó)家級(jí)科技企業(yè)孵化器內(nèi)的企業(yè)")]
  public string v11 { get; set; }
  /// <summary>
  /// 是否屬于國(guó)家大學(xué)科技園內(nèi)的企業(yè)
  /// </summary>
  [Description("屬于國(guó)家大學(xué)")]
  public string v13 { get; set; }
  /// <summary>
  /// 是否國(guó)家備案的眾創(chuàng)空間內(nèi)的企業(yè)
  /// </summary>
  [Description("國(guó)家備案的眾創(chuàng)空間內(nèi)的企業(yè)")]
  public string v20 { get; set; }
  /// <summary>
  /// 企業(yè)注冊(cè)類型
  /// </summary>
  [Description("企業(yè)注冊(cè)類型")]
  public string v22 { get; set; }
  /// <summary>
  /// 注冊(cè)資本
  /// </summary>
  [Description("注冊(cè)資本")]
  public string v24 { get; set; }
  /// <summary>
  /// 實(shí)收資本(萬(wàn)元人民幣)
  /// </summary>
  [Description("實(shí)收資本")]
  public string v25 { get; set; }
  /// <summary>
  /// 企業(yè)注冊(cè)地址
  /// </summary>
   [Description("企業(yè)注冊(cè)地址")]
  public string v26 { get; set; }
  /// <summary>
  /// 郵政編碼
  /// </summary>
  [Description("注冊(cè)地郵政編碼")]
  public string v27 { get; set; }
  /// <summary>
  /// 通信地址
  /// </summary>
   [Description("通信地址")]
  public string v28 { get; set; }
  /// <summary>
  /// 郵政編碼
  /// </summary>
   [Description("通訊地郵政編碼")]
  public string v29 { get; set; }
  /// <summary>
  /// 企業(yè)網(wǎng)址
  /// </summary>
  [Description("企業(yè)網(wǎng)址")]
  public string v30 { get; set; }
  /// <summary>
  /// 企業(yè)官方微信
  /// </summary>
  [Description("企業(yè)官方微信")]
  public string v31 { get; set; }
  /// <summary>
  /// 職工總數(shù)
  /// </summary>
   [Description("職工總數(shù)")]
  public string v32 { get; set; }
  /// <summary>
  /// 博 士人數(shù)
  /// </summary>
  [Description("博 士")]
  public string v33 { get; set; }
  /// <summary>
  /// 碩 士人數(shù)
  /// </summary>
  [Description("碩 士")]
  public string v34 { get; set; }
  /// <summary>
  /// 本 科人數(shù)
  /// </summary>
  [Description("本 科")]
  public string v35 { get; set; }
  /// <summary>
  /// 大專及以下人數(shù)
  /// </summary>
  [Description("大專及以下")]
  public string v36 { get; set; }
  /// <summary>
  /// 高級(jí)職稱人數(shù)
  /// </summary>
  [Description("高級(jí)職稱")]
  public string v37 { get; set; }
  /// <summary>
  /// 中級(jí)職稱人數(shù)
  /// </summary>
  [Description("中級(jí)職稱")]
  public string v38 { get; set; }
  /// <summary>
  /// 初級(jí)職稱人數(shù)
  /// </summary>
  [Description("初級(jí)職稱")]
  public string v39 { get; set; }
  /// <summary>
  /// 高級(jí)技工人數(shù)
  /// </summary>
  [Description("高級(jí)技工")]
  public string v40 { get; set; }
  /// <summary>
  /// 上市公司控股企業(yè)是否
  /// </summary>
  [Description("上市公司控股企業(yè)")]
  public string v41 { get; set; }
  /// <summary>
  /// 新三板企業(yè)是否
  /// </summary>
  [Description("新三板企業(yè)")]
  public string v42 { get; set; }
  /// <summary>
  /// 高新技術(shù)企業(yè)是否
  /// </summary>
  [Description("高新技術(shù)企業(yè)")]
  public string v43 { get; set; }
  /// <summary>
  /// 獲得時(shí)間
  /// </summary>
  [Description("獲得時(shí)間")]
  public string v44 { get; set; }
  /// <summary>
  /// 登記入庫(kù)的科技型中小企業(yè)是否
  /// </summary>
  [Description("登記入庫(kù)的科技型中小企業(yè)")]
  public string v45 { get; set; }
  /// <summary>
  /// 企業(yè)概要(不超1000字)
  /// </summary>
  [Description("企業(yè)概要")]
  public string v46 { get; set; }
  /// <summary>
  /// 關(guān) 鍵 詞
  /// </summary>
  [Description("關(guān) 鍵 詞")]
  public string v47 { get; set; }
  /// <summary>
  /// 現(xiàn)融資階段
  /// </summary>
  [Description("現(xiàn)融資階段")]
  public string v48 { get; set; }
  /// <summary>
  /// 參賽項(xiàng)目產(chǎn)品圖片
  /// </summary>
  public string v49 { get; set; }
  /// <summary>
  /// 參賽項(xiàng)目收入占去年企業(yè)營(yíng)業(yè)收入比例
  /// </summary>
  [Description("參賽項(xiàng)目收入占去年企業(yè)營(yíng)業(yè)收入比例")]
  public string v50 { get; set; }
  /// <summary>
  /// 參賽項(xiàng)目介紹(1000字以內(nèi))
  /// </summary>
  [Description("參賽項(xiàng)目介紹(1000字以內(nèi))")]
  public string v51 { get; set; }
  /// <summary>
  /// 當(dāng)前五大客戶
  /// </summary>
  [Description("當(dāng)前五大客戶")]
  public string v52 { get; set; }
  /// <summary>
  /// 當(dāng)前五大供應(yīng)商
  /// </summary>
  [Description("當(dāng)前五大供應(yīng)商")]
  public string v53 { get; set; }
  /// <summary>
  /// 國(guó)內(nèi)市場(chǎng)地位排名
  /// </summary>
  [Description("國(guó)內(nèi)市場(chǎng)地位排名")]
  public string v54 { get; set; }
  /// <summary>
  /// 商業(yè)模式及業(yè)務(wù)拓展計(jì)劃
  /// </summary>
  [Description("商業(yè)模式及業(yè)務(wù)拓展計(jì)劃")]
  public string v56 { get; set; }
  /// <summary>
  /// 經(jīng)營(yíng)風(fēng)險(xiǎn)與對(duì)策
  /// </summary>
  [Description("經(jīng)營(yíng)風(fēng)險(xiǎn)與對(duì)策")]
  public string v57 { get; set; }
  /// <summary>
  /// 企業(yè)管理模式
  /// </summary>
  [Description("企業(yè)管理模式")]
  public string v58 { get; set; }
  /// <summary>
  /// 公司對(duì)管理層及關(guān)鍵人員是否已采取激勵(lì)措施是否
  /// </summary>
  [Description("公司對(duì)管理層及關(guān)鍵人員是否已采取激勵(lì)措施")]
  public string v59 { get; set; }
  /// <summary>
  /// 公司是否考慮員工持股問(wèn)題?是否
  /// </summary>
  [Description("公司是否考慮員工持股問(wèn)題")]
  public string v60 { get; set; }
  /// <summary>
  /// 企業(yè)其他技術(shù)、產(chǎn)品及服務(wù)(1000字以內(nèi))
  /// </summary>
  [Description("企業(yè)其他技術(shù)、產(chǎn)品及服務(wù)(1000字以內(nèi))")]
  public string v61 { get; set; }
  /// <summary>
  /// 參賽目的
  /// </summary>
  [Description("參賽目的")]
  public string v62 { get; set; }
  /// <summary>
  /// 并購(gòu)需求
  /// </summary>
  [Description("并購(gòu)需求")]
  public string v63 { get; set; }
  /// <summary>
  /// 申請(qǐng)大賽組織的大企業(yè)對(duì)接活動(dòng)是否
  /// </summary>
  [Description("申請(qǐng)大賽組織的大企業(yè)對(duì)接活動(dòng)")]
  public string v64 { get; set; }
  /// <summary>
  /// 資金使用計(jì)劃
  /// </summary>
  [Description("債權(quán)融資資金使用計(jì)劃")]
  public string v65 { get; set; }
  /// <summary>
  /// 股權(quán)融資需求是否 
  /// </summary>
  [Description("直接從事研發(fā)科技人員數(shù)")]
  public string v66 { get; set; }
  /// <summary>
  /// 融資金額(萬(wàn)元¥)
  /// </summary>
  [Description("上年度吸納高校應(yīng)屆畢業(yè)生人數(shù)")]
  public string v67 { get; set; }
  /// <summary>
  /// 擬出讓股權(quán)比例
  /// </summary>
  [Description("參賽項(xiàng)目名稱")]
  public string v68 { get; set; }
  /// <summary>
  /// 融資時(shí)間
  /// </summary>
  [Description("產(chǎn)品市場(chǎng)分析及競(jìng)爭(zhēng)優(yōu)勢(shì)")]
  public string v69 { get; set; }
  /// <summary>
  /// 資金使用計(jì)劃
  /// </summary>
  [Description("股權(quán)融資資金使用計(jì)劃")]
  public string v70 { get; set; }
  /// <summary>
  /// 申請(qǐng)大賽推薦投資機(jī)構(gòu)是否 (修改 申請(qǐng)大賽推薦信貸機(jī)構(gòu))
  /// </summary>
  [Description("申請(qǐng)大賽推薦信貸機(jī)構(gòu)")]
  public string v71 { get; set; }
  /// <summary>
  /// 申請(qǐng)大賽組織的融資路演是否 (修改 申請(qǐng)大賽推薦投資機(jī)構(gòu))
  /// </summary>
  [Description("申請(qǐng)大賽推薦投資機(jī)構(gòu)")]
  public string v72 { get; set; }
  /// <summary>
  /// 申請(qǐng)國(guó)家科技成果轉(zhuǎn)化引導(dǎo)基金設(shè)立的子基金推薦 (修改 申請(qǐng)大賽組織的融資路演)
  /// </summary>
  [Description("申請(qǐng)大賽組織的融資路演")]
  public string v73 { get; set; }
  #endregion

  public List<string> GetThisDescriptionName()
  {
   var result = new List<string>();
   GetType().GetProperties().ToList().ForEach(f =>
   {
    var descriptionObj = (DescriptionAttribute[])f.GetCustomAttributes(typeof(DescriptionAttribute), false);
    if (descriptionObj.Length > 0 && !string.IsNullOrWhiteSpace(descriptionObj[0].Description))
    {
     result.Add(descriptionObj[0].Description);
    }
   });
   return result;
  }
 }

其中重要的地方是:需要給每個(gè)字段一個(gè)Description,這里面的值對(duì)應(yīng)的就是word模板中的名稱,如下:

這里因?yàn)閿?shù)據(jù)是保密的,我就將一些字段刪除了,包括word模板中的一些也刪除了,就拿出一部分。

和數(shù)據(jù)庫(kù)交互的部分我也沒(méi)寫,就將查出來(lái)的數(shù)據(jù)先命名一個(gè)_enterpriseStr,最后用Newtonsoft轉(zhuǎn)換成實(shí)體這樣操作了哈:

 EnterpriseEntity enterprise = JsonConvert.DeserializeObject<EnterpriseEntity>(_enterpriseStr);

5、將查出來(lái)的數(shù)據(jù),插入到word中,完成最終的導(dǎo)出:

ExportFileOperator.InsertFormData(enterprise, ref doc.Item1);//實(shí)體數(shù)據(jù)插入
return new ExportFileOperator().FileResult(title, doc.Item1);

其中最重要的方法就是InsertFormData這個(gè),他的實(shí)現(xiàn)如下:

public static void InsertFormData<T>(T objFormData, ref Document document)
{
   NodeCollection allTables = document.GetChildNodes(NodeType.Table, true);
   List<string> headDescribeNameList = GetObjectHeadDescription<T>();//獲取實(shí)體中每個(gè)Description中的值
   foreach (Table tableFirst in allTables)
   {
    for (int headIndex = 0; headIndex < headDescribeNameList.Count; headIndex++)//循環(huán)實(shí)體中的每個(gè)DescribeName
    {
     for (int rowIndex = 0; rowIndex < tableFirst.Rows.Count; rowIndex++)//遍歷word模板中所有的table
     {
      for (int cellIndex = 0; cellIndex < tableFirst.Rows[rowIndex].Cells.Count; cellIndex++)//遍歷模板中所有的table每行的列數(shù)
      {
       if (tableFirst.Rows[rowIndex].Cells[cellIndex].GetText() != null && tableFirst.Rows[rowIndex].Cells[cellIndex].GetText().Contains(headDescribeNameList[headIndex]) &&
         ((tableFirst.Rows[rowIndex].Cells.Count > cellIndex && tableFirst.Rows[rowIndex].Cells[cellIndex + 1] != null && tableFirst.Rows[rowIndex].Cells[cellIndex + 1].GetText().Equals("\a")) || (tableFirst.Rows.Count > rowIndex && tableFirst.Rows[rowIndex + 1] != null && tableFirst.Rows[rowIndex + 1].Cells[cellIndex] != null && tableFirst.Rows[rowIndex + 1].Cells[cellIndex].GetText().Equals("\a"))))//如果遍歷的cell不為空、其中的值能和DescribeName匹配上,并且這個(gè)單元的右邊的cell或者下邊cell有占位,而且是空,就在此處插入值
       {
        var objValue = GetObjectValueByPropName(objFormData, headDescribeNameList[headIndex]);//根據(jù)DescribeName獲取對(duì)應(yīng)的值
        if (tableFirst.Rows[rowIndex].Cells.Count > cellIndex && tableFirst.Rows[rowIndex].Cells[cellIndex + 1] != null && tableFirst.Rows[rowIndex].Cells[cellIndex + 1].GetText().Equals("\a"))
        {
         InsertCell(objValue, document, tableFirst.Rows[rowIndex].Cells[cellIndex + 1]);//優(yōu)先在右變空位插入值
         break;
        }
        InsertCell(objValue, document, tableFirst.Rows[rowIndex + 1].Cells[cellIndex]);//右側(cè)如果沒(méi)有就在下邊空位插入值
        break;
       }
      }
     }
    }
   }
 }
 public static List<string> GetObjectHeadDescription<T>()
{
 var obj = Activator.CreateInstance<T>();
 MethodInfo method = obj.GetType().GetMethod("GetThisDescriptionName", new Type[] { });//每個(gè)實(shí)體需要有GetThisDescriptionName這個(gè)方法
 return (List<string>)(method?.Invoke(obj, null));
 }

其中GetThisDescriptionName方法需求在每個(gè)實(shí)體類中有實(shí)現(xiàn):

根據(jù)descriptionName獲取實(shí)體中的值:

private static string GetObjectValueByPropName<T>(T objFormData, string descriptionName)
{
   try
   {
    var properties = objFormData.GetType().GetProperties();
    foreach (var propertyInfo in properties)
    {
     var descriptionAttributes = (DescriptionAttribute[])propertyInfo.GetCustomAttributes(typeof(DescriptionAttribute), false);
     if (descriptionAttributes.Length > 0 && !string.IsNullOrWhiteSpace(descriptionAttributes[0].Description) && descriptionAttributes[0].Description.Equals(descriptionName))
     {
      return propertyInfo.GetValue(objFormData) == null ? "無(wú)" : propertyInfo.GetValue(objFormData).ToString();
     }
    }
    return "無(wú)";
   }
   catch (Exception e)
   {
    Console.WriteLine(e);
    throw;
   }
}

在cell中插入值:

private static void InsertCell(string value, Document doc, Cell cell)
 {
   Cell insertCell = cell;
   insertCell.FirstParagraph.Remove();
   Paragraph p = new Paragraph(doc);
   p.AppendChild(new Run(doc, (value == null ? "" : value)));
   p.ParagraphFormat.Alignment = ParagraphAlignment.Center;
   insertCell.CellFormat.VerticalAlignment = CellVerticalAlignment.Center;
   insertCell.AppendChild(p);
 }

最后一個(gè)方法FileResult:

public FileResult FileResult(string fileName, Document doc)
{
   var filePathName = $"{fileName}.doc";
   doc.Save(Path.Combine(_tempPath, "temp", filePathName), SaveFormat.Doc); //保存word
   filePathName = Path.Combine(_tempPath, "temp", filePathName);
   return File(filePathName, "application/doc", $"{fileName}.Doc");
}

最終效果:

最后說(shuō)一下,其中有一些細(xì)節(jié)的地方還是需要做一些處理,暫時(shí)沒(méi)時(shí)間寫,后期有時(shí)間補(bǔ),先就這樣了

大家有什么好的想法或者更好的實(shí)現(xiàn)方式,盡管提出來(lái),共同進(jìn)步

git地址:https://github.com/Binzm/ExportWorkdModel.git

總結(jié)

到此這篇關(guān)于C#中word導(dǎo)出功能騷操作的文章就介紹到這了,更多相關(guān)C# word導(dǎo)出功能內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • FileShare枚舉的使用小結(jié)(文件讀寫鎖)

    FileShare枚舉的使用小結(jié)(文件讀寫鎖)

    其實(shí)/FileShare就是控制文件流的“訪問(wèn)權(quán)限”,當(dāng)然,這僅僅是入門的文件操作,自己做了筆記,也希望能給大家?guī)?lái)幫助
    2014-01-01
  • C#特性-對(duì)象集合初始化器介紹

    C#特性-對(duì)象集合初始化器介紹

    在寫一些實(shí)體類的時(shí)候,我們往往在寫構(gòu)造方法的時(shí)候思考很長(zhǎng)時(shí)間,除了一個(gè)無(wú)參構(gòu)造器外還在想需要寫幾個(gè)構(gòu)造器呢?哪些參數(shù)是需要初始化的。現(xiàn)在你再也不需要為這事煩惱了
    2014-12-12
  • C#中單問(wèn)號(hào)(?)和雙問(wèn)號(hào)(??)的用法整理

    C#中單問(wèn)號(hào)(?)和雙問(wèn)號(hào)(??)的用法整理

    本文詳細(xì)講解了C#中單問(wèn)號(hào)(?)和雙問(wèn)號(hào)(??)的用法,文中通過(guò)示例代碼介紹的非常詳細(xì)。對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-05-05
  • c#進(jìn)度條 progressBar 使用方法的小例子

    c#進(jìn)度條 progressBar 使用方法的小例子

    1、創(chuàng)建進(jìn)度條窗口2、在其他窗口中調(diào)用方法ShowProcess(int percent,string message)
    2013-04-04
  • Unity實(shí)現(xiàn)人物平滑轉(zhuǎn)身

    Unity實(shí)現(xiàn)人物平滑轉(zhuǎn)身

    這篇文章主要為大家詳細(xì)介紹了Unity實(shí)現(xiàn)人物平滑轉(zhuǎn)身,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2020-01-01
  • C# StringBuilder和string

    C# StringBuilder和string

    這篇文章主要介紹了C# StringBuilder和string,文章圍繞StringBuilder和string的相關(guān)資料展開(kāi)內(nèi)容,需要的朋友可以參考一下
    2021-11-11
  • C#生成隨機(jī)驗(yàn)證碼代碼分享

    C#生成隨機(jī)驗(yàn)證碼代碼分享

    這篇文章主要分享了C#生成隨機(jī)驗(yàn)證碼代碼,另外附上使用示例,非常的簡(jiǎn)單實(shí)用,有需要的朋友可以參考下
    2014-10-10
  • C#讀取XML中元素和屬性值的實(shí)現(xiàn)代碼

    C#讀取XML中元素和屬性值的實(shí)現(xiàn)代碼

    用C#讀取xml有很多方式,這里我就先使用XmlDocument讀取Xml,用一段代碼遍歷所有元素,并打印student的所有屬性和子節(jié)點(diǎn)的值
    2013-04-04
  • c# 控件截圖的簡(jiǎn)單實(shí)例

    c# 控件截圖的簡(jiǎn)單實(shí)例

    這篇文章介紹了c# 控件截圖的簡(jiǎn)單實(shí)例,有需要的朋友可以參考一下
    2013-10-10
  • 基于C#實(shí)現(xiàn)音樂(lè)文件的播放功能

    基于C#實(shí)現(xiàn)音樂(lè)文件的播放功能

    本文介紹了如何使用C#編寫一個(gè)簡(jiǎn)單的程序來(lái)實(shí)現(xiàn)音樂(lè)文件的播放功能,程序能夠讀取MP3文件和ogg文件,并通過(guò)合適的控件進(jìn)行播放,同時(shí),程序具備處理異常、良好的用戶界面和兼容性的特點(diǎn),感興趣的朋友可以自己動(dòng)手嘗試一下
    2024-05-05

最新評(píng)論

庆元县| 察隅县| 合阳县| 绥芬河市| 荣成市| 揭东县| 利津县| 远安县| 闽侯县| 哈尔滨市| 安国市| 盐源县| 获嘉县| 河南省| 武安市| 水城县| 兴化市| 海原县| 兴海县| 巴中市| 敖汉旗| 堆龙德庆县| 东光县| 扶绥县| 登封市| 塘沽区| 获嘉县| 府谷县| 云霄县| 霞浦县| 金沙县| 宜都市| 江安县| 寻甸| 开远市| 延寿县| 华容县| 新竹市| 杭锦旗| 肥东县| 荣成市|