Menu

Showing posts with label text. Show all posts
Showing posts with label text. Show all posts

Friday, December 6, 2019

[Security] การเข้ารหัสและถอดรหัสไฟล์โดยใช้ Public และ Private Keys
[Security] File Encryption and Decryption by Using Public and Private Keys


สมมติว่า มีไฟล์ที่เกี่ยวข้องดังนี้
  • key.pem เป็นไฟล์ Private key
  • pub.pem เป็นไฟล์ Public key
  • data.txt เป็นไฟล์ข้อความที่ต้องการเข้ารหัส
หมายเหตุ กรณีที่ยังไม่มีไฟล์ key.pem และ pub.pem อ่านวิธีสร้างได้ที่ การสร้าง Private Key และ Public Key ด้วย OpenSSL

Monday, October 21, 2013

[C#] วิธีการเขียนไฟล์ข้อความ
[C#] How to Write Text File

ขั้นแรก เพิ่มประโยค using ตามด้านล่าง
First, add using statement
  1. using System.IO.StreamWriter;

ขั้นที่สอง ประกาศและนิยามออบเจ็ค StreamWriter ใหม่ เพื่อเขียนไฟล์ข้อความไปที่ file_path
Second, declare and define new StreamWriter object to write text file at file_path
  1. StreamWriter file = new StreamWriter(file_path);

Monday, June 3, 2013

[AS3] วิธีการอ่านแถวของข้อความจากไฟล์ข้อความเข้าอาเรย์
[AS3] How to Read Line from Text File to Array

ขั้นแรก สร้างไฟล์ข้อความชื่อ line2array.txt แล้วใส่ข้อความตามด้านล่าง
First, create text file named line2array.txt with add text below
facebook
twitter
google plus
internet explorer
html5

[AS3] วิธีโหลดตัวแปรจากไฟล์ข้อความ
[AS3] How to Load Variables from Text File

ขั้นแรก สร้างไฟล์ข้อความชื่อ variables.txt แล้วใส่ข้อความตามด้านล่าง
First, create text file named variables.txt with add text below
myTitle=Test&myBody=This is test&myURL=www.google.com

รูปแบบของข้อความจะเป็น ชื่อตัวแปร=ค่าของตัวแปร และคั่นด้วยเครื่องหมาย &
The format will be variable_name=variable_value and separated by &