C#实现HTML转WORD及WORD转PDF的方法

2019-12-26 13:37:47王旭
  • {  WorkCell myWorkCell = new WorkCell(textBox2.Text,textBox1.Text); 
  • textBox3.Text = myWorkCell.GetNextCode();  } 
  • }  public class WorkCell 
  • {  private string workCellCode; 
  • private string parentCellCode;  private string commonCode; 
  • private char[] code;  private char[] pCode; 
  • private char[] standCode;  private string s; 
  • public WorkCell( string mycode,string parentcode)  { 
  • workCellCode = mycode;  parentCellCode = parentcode; 
  • standCode = new char[] { '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'W', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };  commonCode = Regex.Replace(parentCellCode,@"0+",""); 
  • code = workCellCode.Substring(commonCode.Length).ToCharArray();  } 
  • public string WorkCellCode  { 
  • set  { 
  • workCellCode = value;  } 
  • get  { 
  • return workCellCode;  } 
  • }  public string ParentCellCode 
  • {   set 
  • {  workCellCode = value; 
  • }  get 
  • {  return workCellCode; 
  • }  } 
  • public string GetNextCode()  { 
  • string s="";  if (code.Length > 0) 
  • {  int i = 0; 
  • for (i = code.Length - 1; i >= 0; i--)  { 
  • if (code[i] != '0')  { 
  • GetNextChar(i);  break; 
  • }  }