Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: i have Some Problems in learning ASP.net(C#)


Message #1 by "ZhangLei" <lserlohn@y...> on Sun, 23 Feb 2003 06:32:17
// C# Document save asmathExchange.cs£¬and Complie to mathExchange.dll,put 
it under \bin (the program is easy ,but it also makes an error) 

namespace  ZhangWebTest 
{ 
    public class  MathExchange{ 
         private  double  ChangeHuaTep(double HuaTep) 
   { 
      return HuaTep*(9/5)+32; 
  } 
 private double ChangeSheTep(double SheTep) 
   { 
      return  (SheTep-32)*(5/9); 
} 
 private double   ChangeInch(double Inch ) 
   { 
      return  0.6214*Inch; 
  } 
 private double ChangeKiloMeter(double KiloMeter) 
  {    
     return 1.6039*KiloMeter; 
 } 
} 
 }   
**********************the asp.net file
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" %
> 
<%@ Import NameSpace="ZhangWebTest"%> 
<script language="C#" runat="server"> 
MathExchange TheMathExchange=new MathExchange(); 
double HuaTep=35.32; 
double SheTep=TheMathExchange.ChangeHuaTep(HuaTep); 
string TheSheTep=SheTep.ToString(); 
Response.Write(TheSheTep); 


</script> 
<html> 
<head> 
<title>ÎÞ±êÌâÎĵµ</title> 
</head> 
<body> 

</body> 
</html> 

***********is the method  error?,help me please thanks***

  Return to Index