if   not   rs.eof   then   
  while   not   rs.eof   
  OrderDate=right(trim(rs("InID")),14)    '09110603001  
  'response.Write OrderDate+1    '10011405001 
  if   trim(Left(OrderDate,8))=ToDay   then
  GetLastID=OrderDate+1  
  
  if len(GetLastID)=10 then GetLastID="0"&GetLastID
  GetLastID=company_py&right(GetLastID,12)  
  else   
  GetLastID=ToDay+"001"   
  GetLastID=company_py&GetLastID   
  end   if     rs.movenext   
  wend   
  else   
  GetLastID=company_py+ToDay+"001"   
  end   if   
这段是asp的代码   怎么用c#来表示?

解决方案 »

  1.   

    if(条件){
     内容
    }else{
     
    }
      

  2.   


    if  (!rs.eof)  
    {  
      while(!rs.eof)
    {  
      OrderDate=right(trim(rs("InID")),14)    //09110603001  
      //response.Write OrderDate+1    //10011405001 
      if  (trim(Left(OrderDate,8))==ToDay ) 
      GetLastID=OrderDate+1;  
      
      if (len(GetLastID)==10)  
      {
      GetLastID="0"&GetLastID; 
      GetLastID=company_py&right(GetLastID,12);  
      else  
      GetLastID=ToDay+"001";  
      GetLastID=company_py&GetLastID;
      }    rs.movenext;
      }  
      else  
      GetLastID=company_py+ToDay+"001" ; 
      }  大致的用C#的语法改了一下,还有if  then是分支语句而不是循环语句哦~~