スキップしてメイン コンテンツに移動

投稿

ExportSWC - FlashDevelopでswcファイルを生成

ExportSWC というアドインで FlashDevelop からswcファイルを生成できます。 私はこのアドインを使って、swcファイルを生成しようとしたのですが、以下のエラーに遭遇しました。 --- Error: could not find source for resource bundle containers. Error: could not find source for resource bundle core. Error: could not find source for resource bundle effects. Error: could not find source for resource bundle skins. Error: could not find source for resource bundle styles. --- Google先生で調べてみると、以下のページを見つけました。 Unable To Generate a SWC if using a third party SWC 結論から書きますと、 -library-path {flexSDK}/frameworks/locale/en_US をCompiler Optionに加えればいいようです。私は面倒くさかったので、必要なswcファイルを全部かき集めて1つのディレクトリ(例:lib)に入れて、 -library-path lib をCompiler Optionに加えてコンパイルしました。:)

C#: SaveFileDialogの使用サンプル

SaveFileDialogの基本的な使い方を以下に示します。他の種類のダイアログでも基本的な使い方は同じです。 SaveFileDialog dialog = new SaveFileDialog(); dialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"; dialog.FilterIndex = 2; dialog.RestoreDirectory = true; if (dialog.ShowDialog() == DialogResult.OK) { MessageBox.Show("Saved!"); }

WebRequestクラスを使ってStringをPostするコード

使用するEncodingはUTF-8を仮定しています。 public static void PostData(string host, int port, string data) { try { Uri requestUri = new Uri(string.Format("http://{0}:{1}/", host, port)); WebRequest request = WebRequest.Create(requestUri); request.Proxy = new WebProxy(); request.Method = "POST"; byte[] postDataBytes = Encoding.UTF8.GetBytes(data); request.ContentLength = postDataBytes.Length; using (Stream stream = request.GetRequestStream()) { stream.Write(postDataBytes, 0, postDataBytes.Length); WebResponse response = request.GetResponse(); using (StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8)) { string strResp = reader.ReadToEnd(); // Do something... } } } catch (Exception ex) { log.ErrorFormat("Error in {0} method\n{1}", MethodBase.GetCurrentM

C++.NetでのThreadの実行方法

C++.NetでのThreadの実行方法です。C#でThreadの使い方を知っていれば、理解はしやすいと思います。 using namespace System; using namespace System::Threading; ref class Work { public: static void DoWork() { Console::WriteLine( "Static thread procedure." ); } void DoMoreWork() { Console::WriteLine( "Instance thread procedure."); } }; int main(array ^args) { Work ^w = gcnew Work; ThreadStart ^start = gcnew ThreadStart(w, &Work::DoMoreWork); Thread ^t = gcnew Thread(start); t->Start(); Console::ReadLine(); return 0; }