2015年3月19日 星期四

java第三周上課內容

excel vba forloop 展示1~10


java 展示 1~10

程式碼

class ForDemo1 {
    public static void main(String[] args) {
         int i;
        for (i = 1; i <= 10; i++) {
            System.out.println(i);
        }
    }
}


javascript 展示 1~10

程式碼


<HTML>
<HEAD>
</HEAD>
<BODY>

<script language="JavaScript">
for (i=1; i<=10; i=i+1)
{
document.write(i );
}
</SCRIPT>
</BODY>
</HTML>



2015年3月12日 星期四

java第二周上課內容

超連結:http://taiwantc.com/js/js_tut_a1.htm
打開wordpad 複製以下內容
<html>
<head>
<title> The First Example: Hello, World </title>
</head>
<body>
<h2> This line is HTML </h2>

<script language="JavaScript">
<!--
document.write("Hello, 楊大寬.This sentence is written using JavaScript.");
// Text on the right of 2 slashes is comment
/* This is comment
that occur more than 1 line
*/
//-->
</script>
<noscript>
Sorry, but your browser doesn't run JavaScript.
</noscript>

<h2> This line is HTML </h2>
</body>
</html>

儲存名稱 firstjava.html
使用google chrome開啟 IE不可


java檢查ip

import java.net.*;

public class TestInet1 {
  public static void main(String argv[]) 
  {
    try {
      InetAddress myip = InetAddress.getLocalHost();

      System.out.println(myip.getHostName());
      System.out.println(myip.getHostAddress());
    } catch (UnknownHostException e) {
      System.out.println("Error: unable to resolve localhost");
    }
  }
}

javascript 查ip

<script language="JavaScript">
VIH_BackColor = "palegreen";
VIH_ForeColor = "navy";
VIH_FontPix = "16";
VIH_DisplayFormat = "You are visiting from:<br>IP Address: %%IP%%<br>Host: %%HOST%%";
VIH_DisplayOnPage = "yes";
</script>
<script language="JavaScript" src="http://scripts.hashemian.com/js/visitorIPHOST.js.php"></script>


2015年3月5日 星期四

java 第一周上課內容

1.為何why要選修這門課?(動機)
A:學習Java
2.希忘從這門課獲得那些知識?(目標)
A:Java相關知識
3.我要如何修習這一門課?(態度與方法)
A:認真(應該)

環境變數



第一周實作

class Test
{
public static void main(String[] args)
{
System.out.println("_____*_____");
System.out.println("____***____");
System.out.println("___*****___");
System.out.println("__*******__");
System.out.println("_____*_____");
System.out.println("_____*_____");
}
}