日前教授在部落格放了一個隨身碟防寫小軟體,學生捉了後其實有點驚嚇到...因為圖示打了個大叉叉,猶豫了許久打開了該軟體竟然又亂碼,所以稍微找了下,看到電腦不難部落格有reg改法如下:
防寫:
解除:
事實上只要將以上內容貼入記事本並且選擇存檔類型為"所有檔案"另存為『lockusb.bat』與『unlockusb.bat』即可。
如此一來就有兩個方便開關的執行檔,也不用擔心這個程式到底有沒有問題,畢竟只是兩行純文字...。
使用方法:
1.插入隨身碟前執行防寫命令。
懶人用...防寫、解除。
本人僅在XP測試,至於Vista、Windows7不曉得是否也行的通。
2011年5月28日 星期六
2011年5月10日 星期二
MDE電腦教室防隨身碟病毒小工具(已無效)
2011.5.17補充:
電腦教室有更強的病毒,
現在這招已經擋不住啦~
java applet drawstar
畫星星函式
php call java in cmsimple
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | public void cad_drawstar(Graphics g, int x, int y, int r, int angle) { Graphics2D graph = (Graphics2D)g; double deg,temp1,temp2,temp3,temp4; deg= 3.14159 / 180.0 ; double pt_x[] = new double [ 7 ]; //java 宣告陣列 格式 double pt_y[] = new double [ 7 ]; double ptt_x[] = new double [ 7 ]; double ptt_y[] = new double [ 7 ]; int i,j; for (i= 0 ;i< 7 ;i++){ pt_x[i]=x+r*Math.sin( 72 .*deg*i+angle*deg); //sin cos 三角函數 使用格式 Math. pt_y[i]=y-r*Math.cos( 72 .*deg*i+angle*deg); temp1=Math.cos( 54 .*deg- 72 .*deg*i-angle*deg); temp2=Math.sin( 54 .*deg- 72 .*deg*i-angle*deg); temp3=Math.sin( 18 .*deg); temp4=Math.cos( 36 .*deg); ptt_x[i]=x+r*temp3*temp1/temp4; ptt_y[i]=y-r*temp3*temp2/temp4; } for (i= 0 ;i< 5 ;i++){ graph.drawLine(( int )pt_x[i],( int )pt_y[i],( int )ptt_x[i],( int )ptt_y[i]); //graph.drawLine 內的點必須是 int 因此把double 等變數強制轉換 j=i+ 1 ; graph.drawLine(( int )ptt_x[i],( int )ptt_y[i],( int )pt_x[j],( int )pt_y[j]); } } |
1 2 3 4 5 6 | <?php function HelloWorldApp(){ $output = "<applet codebase=\"plugins/test\" code=\"HelloWorldApp\" height=\"500\" width=\"500\"></applet>" ; return $output ; } ?> |
2011年5月3日 星期二
Java Applet HTML 新舊版嵌入語法
Class 檔案嵌入
舊版 HTML4 :
新版 HTML5 (測試階段):
Jar 檔案嵌入
舊版 HTML4 :
新版 HTML5 (測試階段):
舊版 HTML4 :
1 2 3 | < applet codebase = "Hello/World" code = "HelloWorld.class" height = "500" width = "500" > < param name = "Number" value = "1" /> </ applet > |
新版 HTML5 (測試階段):
1 2 3 | < object type = "application/x-java-applet" codebase = "Hello/World" code = "HelloWorld.class" height = "500" width = "500" > < param name = "Number" value = "9" /> </ object > |
Jar 檔案嵌入
舊版 HTML4 :
1 2 3 | < applet archive = "Hello/World" code = "HelloWorld.jar" height = "500" width = "500" > < param name = "Number" value = "8" /> </ applet > |
新版 HTML5 (測試階段):
1 2 3 | < object type = "application/x-java-applet" archive = "Hello/World" code = "HelloWorld.jar" height = "500" width = "500" > < param name = "Number" value = "7" /> </ object > |
c php applet
c 將波浪寫入txt檔
php 取得值並呼叫c執行檔
java applet由php 取值給入
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #include <stdio.h> #include <stdlib.h> void helloworld( int e){ FILE *fp1; fp1= fopen ( "output.txt" , "w" ); int s,point; for (s=1;s<=e;s++){ fprintf (fp1, "Hello World" ); //fprintf主要目的是供你將資料,以格式化方式寫入某檔案內 /*fprintf( )和printf( )兩者唯一的差別是, printf( )會將資料列印在螢幕上,而fprintf( )會將資料列印在某個檔案內。*/ for (point=1;point<=s;point++){ fprintf (fp1, "!" ); } fprintf (fp1, "\n" ); } for (s=e-1;s>0;s--){ fprintf (fp1, "Hello World" ); for (point=1;point<=s;point++){ fprintf (fp1, "!" ); } fprintf (fp1, "\n" ); } fclose (fp1); } int main( int argc, char ** argv) { // int number; if (argc > 1) number = ( int ) atoi (argv[1]); else number = 50; helloworld(number); return 0; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | <?php /************************************************** File:phpCallexe.php Name:執行exe Explain:呼叫C語言並執行 ****************************************By QQBoxy*/ if (isset( $_GET [ 'n' ])) $num = $_GET [ 'n' ]; else $num = 20; $cmd = exec ( 'c1.exe ' . $num ); execInBackground( $cmd ); echo 'It OK!!' ; //------------------------------------------------------- function execInBackground( $cmd ) { if ( substr (php_uname(), 0, 7) == "Windows" ){ pclose(popen( "start /B " . $cmd . "" , "r" )); } else { exec ( $cmd . " " . $num . " > /dev/null &" ); } } //------------------------------------------------------- ?> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | import java.applet.Applet; import java.awt.*; // for Frame Exit import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; public class HelloWorldApp extends Applet { Stroke drawingStroke = new BasicStroke( 2 ); public void init() { } public void paint(Graphics g) { int i,p; String peakNumber = "" ; peakNumber = getParameter( "peakNumber" ); if (peakNumber != null ) { // 轉成整數使用 Integer.parseInt() // 轉為浮點數使用 Float.parseFloat() p = Integer.parseInt(peakNumber); } else { // 若 peakNumber 取不到值, 則內定為 5 p = 10 ; } Graphics2D graph = (Graphics2D)g; graph.setStroke(drawingStroke); graph.setPaint(Color.black); for (i= 1 ;i<=p;i++) { graph.drawString( "Hello World" , 10 , 10 +i* 20 ); printC(graph,i, 80 , 10 +i* 20 ); } for (i=p- 1 ;i>= 1 ;i--) { //graph.drawString("Hello World", 10, 10+(10+10-i)*20); //printC(graph,i, 80, 10+(10+10-i)*20); graph.drawString( "Hello World" , 10 , 20 + 10 +( 2 *p- 1 )* 20 - 20 *i); printC(graph,i, 80 , 20 + 10 +( 2 *p- 1 )* 20 - 20 *i); } } public void stop() { } public void printC(Graphics g, int m, int x, int y){ Graphics2D graph = (Graphics2D)g; int i; for (i= 0 ;i<m;i++) { graph.drawString( "!" , x+i* 10 , y); } } public static void main(String[] args) { Frame frm = new Frame( "我的主方法(函式)框架" ); Applet applet = new HelloWorldApp(); frm.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit( 0 ); } }); frm.setSize( 100 , 100 ); frm.setVisible( true ); // 將 applet 加入 Frame 中 frm.add(applet); frm.setSize( 300 , 300 ); frm.setVisible( true ); applet.init(); } // 結束 main /* Command Lines int i = 0; for(i=1;i<=10;i++) { System.out.print("Hello World"); printC(i); System.out.print("\n"); } for(i=9;i>=1;i--) { System.out.print("Hello World"); printC(i); System.out.print("\n"); } } static void printC(int m){ int i; for(i=0;i<m;i++) { System.out.print("!"); } } */ } // 結束 HelloWorldApp class |
java applet由php 取值給入
1 2 3 | <applet code= "HelloWorldApp" height= "500" width= "500" > <param name= "peakNumber" value= "10" /> </applet> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | import java.applet.Applet; import java.awt.*; public class HelloWorldApp extends Applet { Stroke drawingStroke = new BasicStroke( 2 ); // static 變數才可以在各方法中共用 String peakNumber = "" ; int number; public void init() { peakNumber = getParameter( "peakNumber" ); if (peakNumber != null ) { // 轉成整數使用 Integer.parseInt() // 轉為浮點數使用 Float.parseFloat() number = Integer.parseInt(peakNumber); } else { // 若 peakNumber 取不到值, 則內定為 5 number = 5 ; } } public void paint(Graphics g) { int i; Graphics2D graph = (Graphics2D)g; graph.setStroke(drawingStroke); graph.setPaint(Color.black); for (i= 1 ;i<=number;i++) { // 每一行向下增量 20 單位 graph.drawString( "Hello World" , 10 , 10 +i* 20 ); printC(graph,i, 80 , 10 +i* 20 ); } for (i=number- 1 ;i>= 1 ;i--) { // 必須考慮前半部已經增量 number*20 graph.drawString( "Hello World" , 10 , 10 +(number+number-i)* 20 ); printC(graph,i, 80 , 10 +(number+number-i)* 20 ); } } public void printC(Graphics g, int m, int x, int y){ Graphics2D graph = (Graphics2D)g; int i; for (i= 0 ;i<m;i++) { graph.drawString( "!" , x+i* 10 , y); } s(graph, 20 , 20 , 15 ); } public void s(Graphics g, int x, int y, int s){ Graphics2D graph = (Graphics2D)g; graph.drawLine(x, y, x+s, y); graph.drawLine(x+s, y, x+s, y+s); graph.drawLine(x+s, y+s, x, y+s); graph.drawLine(x, y+s, x, y); } public void square(Graphics g, int x, int y, int s){ Graphics2D graph = (Graphics2D)g; graph.drawLine(x, y, x+s, y+s); } } |
訂閱:
文章 (Atom)