
// Golang Server
package main
import (
"net/http"
"fmt"
)
黃彥霖 發表在 痞客邦 留言(0) 人氣(917)
package main
import (
"net/http"
"fmt"
)
黃彥霖 發表在 痞客邦 留言(0) 人氣(2,202)
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
public Texture2D t; // 將外部圖片套用至此處,圖片要到 Advanced 設定為可讀可寫才行喔 (否則會失敗)
黃彥霖 發表在 痞客邦 留言(0) 人氣(1,824)
先建立一個 index.html 檔,把下面 HTML 語法複製貼上,再將 html 檔移動到 Golang 專案下
<html>
<head>
<title>Golang upload</title>
</head>
<body>
<form id="uploadForm" method="POST" enctype="multipart/form-data" action="http://127.0.0.1:8080/upload">
<p>Golang upload</p>
<input type="FILE" id="file" name="file" />
<input type="SUBMIT" value="upload">
</form>
</body>
</html>
黃彥霖 發表在 痞客邦 留言(0) 人氣(866)
using UnityEngine;
using System.Collections;
using System.Net;
public class NewBehaviourScript2 : MonoBehaviour {
黃彥霖 發表在 痞客邦 留言(0) 人氣(1,400)
package main
import (
"fmt"
"net/http"
)
黃彥霖 發表在 痞客邦 留言(0) 人氣(830)
// 目的資料夾一定要存在,否則不會自動幫你建立
// 如果原本已經有檔案在的話,會覆蓋掉
package main
import (
"bufio"
"os"
)
黃彥霖 發表在 痞客邦 留言(0) 人氣(744)
using UnityEngine;
using System.Collections;
using System;
using System.Net;
using System.Net.Sockets;
using System.IO;
黃彥霖 發表在 痞客邦 留言(1) 人氣(926)
using System.Security.Cryptography; // 記得匯入
FileStream f = new FileStream("C:/A.png", FileMode.Open);
MD5 m = MD5.Create();
byte [] hashb = m.ComputeHash(f);
f.Close();
string sm = "";
for(int k = 0; k < hashb.Length; k++){
sm += hashb[k] + " ";
}
print("MD5 : " + sm);
黃彥霖 發表在 痞客邦 留言(0) 人氣(559)
for(int i = 0;i<parentObj.transform.childCount;i++){
GameObject go = parentObj.transform.GetChild(i).gameObject;
Destroy(go);
}
黃彥霖 發表在 痞客邦 留言(1) 人氣(3,852)