๗/๑๓/๒๕๕๐
Death Blue Screen (จอฟ้ามหาภัย และรหัสแก้ไข)
ได้อ่าน คิดว่าน่าจะเป็นแนวทางในการแก้ไขปัญหา ได้บ้าง รหัสที่แจ้งของ Blue Screen จริงๆมีเกินร้อยตัว
1.(stop code 0X000000BE) Attempted Write To Readonly Memory
สาเหตุและแนวทางแก้ไข:
อาการนี้เกิดจากการลง driver หรือ โปรแกรม หรือ service ที่ผิดพลาด เช่น ไฟล์บางไฟล์เสีย ไดร์เวอร์คนละรุ่นกัน ทางแก้ไขให้ uninstall โปรแกรมตัวที่ลงก่อนที่จะเกิดปัญหานี้ ถ้าเป็นไดร์เวอร์ก็ให้ทำการ roll back ไดร์เวอร์ตัวเก่ามาใช้ หรือ หาไดร์เวอร์ที่ล่าสุดมาลง (กรณีที่มีใหม่กว่า) ถ้าเป็นพวก service ต่างๆที่เราเปิดก่อนเกิดปัญหาก็ให้ทำการปิด หรือ disable ซะ
2.(stop code 0X000000C2) Bad Pool Caller
สาเหตุและแนวทางแก้ไข:
ตัวนี้จะคล้ายกับตัวข้างบน แต่เน้นที่พวก hardware คือเกิดจากอัฟเกรดเครื่องพวก Hardware ต่าง เช่น ram ,harddisk การ์ดต่างๆ ไม่ compatible กับ XP ทางแก้ไขก็ให้เอาอุปกรณ์ที่อัฟเกรดออก ถ้าจำเป็นต้องใช้ก็ให้ลงไดร์เวอร์ หรือ อัฟเดท firmware ของอุปกรณ์นั้นใหม่ และคำเตือนสำหรับการจะอัฟเดท ให้ปิด anti-virus ด้วยนะครับ เดียวมันจะยุ่งเพราะพวกโปรแกรม anti-virus มันจะมองว่าเป็นไวรัส
3.(stop code 0X0000002E) Data Bus Error
สาเหตุและแนวทางแก้ไข:
อาการนี้เกิดจากการส่งข้อมูลที่เรียกว่า BUS ของฮาร์ดแวร์เสียหาย ซึ่งได้แก่ ระบบแรม ,cache L2 ของซีพียู , เมมโมรีของการ์ดจอ, ฮาร์ดดิสก์ทำงานหนักถึงขั้น error (ร้อนเกินไป) และเมนบอร์ดเสีย
4.(stop code 0X000000D1)Driver IRQL Not Less Or Equal
สาเหตุและแนวทางแก้ไข:
อาการไดร์เวอร์กับ IRQ(Interrupt Request ) ไม่ตรงกัน การแก้ไขก็เหมือนกับ error ข้อที่ 1
5. (stop code 0X0000009F)Driver Power State Failure
สาเหตุและแนวทางแก้ไข:
อาการนี้เกิดจาก ระบบการจัดการด้านพลังงานกับไดรเวอร์ หรือ service ขัดแย้งกัน เมื่อคุณให้คอมทำงานแบบ"hibernate" แนวทางแก้ไข ถ้าวินโดวส์แจ้ง error ไดร์เวอร์หรือ service ตัวไหนก็ให้ uninstall ตัวนั้น หรือจะใช้วิธี Rollback driver หรือ ปิดระบบจัดการพลังงานของวินโดวส์ซะ
6.(stop code 0X000000CE) Driver Unloaded Without Cancelling Pending Operations
สาเหตุและแนวทางแก้ไข:
อาการไดร์เวอร์ปิดตัวเองทั้งๆ ทีวินโดวส์ยังไม่ได้สั่ง การแก้ไขให้ทำเหมือนข้อ 1
7.(stop code 0X000000F2)Hardware Interrupt Storm
สาเหตุและแนวทางแก้ไข:
อาการที่เกิดจากอุปกรณ์ฮาร์ดแวร์ เช่น USB หรือ SCSI controller จัดตำแหน่งกับ IRQ ผิดพลาด สาเหตุจากไดร์เวอร์หรือ firmware การแก้ไขเหมือนกับข้อ 1
8.(stop code 0X0000007B)Inaccessible Boot Device
สาเหตุและแนวทางแก้ไข:
อาการนี้จะมักเจอตอนบูตวินโดวส์ จะมีข้อความบอกว่าไม่สามารถอ่านข้อมูลของไฟล์ระบบหรือ boot partitions ได้ ให้ตรวจฮาร์ดดิสก์ว่าปกติหรือไม่ สายแพหรือสายไฟที่เข้าฮาร์ดดิสก์หลุดหรือไม่ ถ้าปกติดีก็ให้ตรวจไฟล์ boot.ini อาจจะเสีย หรือไม่ก็มีการทำงานแบบmulti OS ให้ตรวจดูว่าที่ไฟล์นี้อาจเขียน config ของ OS ขัดแย้งกัน
อีกกรณีหนึ่งที่เกิด error นี้ คือเกิดขณะ upgrade วินโดวส์ สาเหตุจากมีอุปกรณ์บางตัวไม่ compatible ให้ลองเอาอุปกรณ์ที่ไม่จำเป็นหรือคิดว่ามีปัญหาออก เมื่อทำการ upgrade วินโดวส์ เรียบร้อย ค่อยเอาอุปกรณ์ที่มีปัญหาใส่กลับแล้วติดตั้งด้วยไดร์เวอร์รุ่นล่าสุด
9. (stop code 0X0000007A) Kernel Data Inpage Error
สาเหตุและแนวทางแก้ไข:
อาการนี้เกิดมีปัญหากับระบบ virtual memory คือวินโดวส์ไม่สามารถอ่านหรือเขียนข้อมูลที่ swapfile ได้ สาเหตุอาจเกิดจากฮาร์ดดิสก์เกิด bad sector, เครื่องติดไวรัส, ระบบ SCSI ผิดพลาด, RAM เสีย หรือ เมนบอร์ดเสีย
10. (stop code 0X00000077) Kernel Stack Inpage Error
สาเหตุและแนวทางแก้ไข:
อาการและสาเหตุเดียวกับข้อ 9
11.(stop code 0X0000001E) Kmode Exception Not Handled
สาเหตุและแนวทางแก้ไข:
อาการนี้เกิดการทำงานที่ผิดพลาดของไดร์เวอร์ หรือ service กับ หน่วยความจำ และ IRQ ถ้ามีรายชื่อของไฟล์หรือ service แสดงออกมากับ error นี้ให้ทำการ uninstall โปรแกรมหรือทำการ roll back ไดร์เวอร์ตัวนั้น
ถ้ามีการแจ้งว่า error ที่ไฟล์ win32k สาเหตุเกิดจาก การ control software ของบริษัทอื่นๆ (Third-party) ที่ไม่ใช้ของวินโดวส์ ซึ่งมักจะเกิดกับพวก Networking และ Wireless เป็นส่วนใหญ่
Error นี้อาจจะเกิดสาเหตุอีกอย่าง นั้นคือการ run โปรแกรมต่างๆ แต่หน่วยความจำไม่เพียงพอ
12.(stop code 0X00000079)Mismatched Hal
สาเหตุและแนวทางแก้ไข:
อาการนี้เกิดการทำงานผิดพลาดของ Hardware Abstraction Layer (HAL) มาทำความเข้าใจกับเจ้า HAL ก่อน HAL มีหน้าที่เป็นตัวจัดระบบติดต่อระหว่างฮาร์ดแวร์กับซอฟท์แวร์ว่าแอปพลิเคชั่นตัวไหนวิ่งกับอุปกรณ์ตัวไหนให้ถูกต้อง ยกตัวอย่าง คุณมีซอฟท์แวร์ที่ออกแบบไว้ใช้กับ Dual CPU มาใช้กับเมนบอร์ดที่เป็น Single CPU วินโดว์ก็จะไม่ทำงาน วิธีแก้คือ reinstall วินโดวส์ใหม่
สาเหตุอีกประการการคือไฟล์ที่ชื่อ NToskrnl.exe หรือ Hal.dll หมดอายุหรือถูกแก้ไข ให้เอา Backup ไฟล์ หรือเอา original ไฟล์ที่คิดว่าไม่เสียหรือเวอร์ชั่นล่าสุดก๊อปปี้ทับไฟล์ที่เสีย
13.(stop code 0X0000003F)No More System PTEs
สาเหตุและแนวทางแก้ไข:
อาการนี้เกิดจากระบบ Page Table Entries (PTEs) ทำงานโดย Virtual Memory Manager (VMM) ผิดพลาด ทำให้วินโดวส์ทำงานโดยไม่มี PTEs ซึ่งเป็นสิ่งจำเป็นสำหรับวินโดวส์ อาการนี้มักจะเกิดกับการที่คุณทำงานแบบ multi monitors
ถ้าคุณเกิดปัญหานี้บ่อยครั้ง คุณสามารถปรับแต่ง PTEs ได้ใหม่ ดังนี้
1. ให้เปิด Registry ขึ้นมาแก้ไข โดยไปที่ Start > Run แล้วพิมพ์คำสั่ง Regedit
2. ไปตามคีย์นี้ HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerMemory Management
3. ให้ดูที่หน้าต่างขวามือ ดับคลิกที่ PagedPoolSize ให้ใส่ค่าเป็น 0 ที่ Value data และคลิก OK
4. ดับเบิลคลิกที่ SystemPages ถ้าคุณใช้ระบบจอแบบ Multi Monitor ให้ใส่ค่า 36000 ที่ Value data หรือใส่ค่า 40000 ถ้าเครื่องคุณมี RAM
128 MB และค่า 110000 ในกรณีที่เครื่องมี RAM เกินกว่า 128 MB แล้วคลิก OK
รีสตาร์ทเครื่อง
14.(stop code 0X00000024) NTFS File System
สาเหตุและแนวทางแก้ไข:
อาการนี้สาเหตุเกิดจากการรายงานผิดพลาดของ Ntfs.sys คือไดร์เวอร์ของ NTFS อ่านและเขียนข้อมูลผิดพลาด สาเหตูนี้รวมถึง การทำงานผิดพลาดของ controller ของ IDE หรือ SCSI เนื่องจากการทำงานของโปรแกรมสแกนไวรัส หรือ พื้นที่ของฮาร์ดดิสก์เสีย คุณๆสามารถทราบรายละเอียดของerror นี้ได้โดยให้เปิดดูที่ Event Viewer วิธีเปิดก็ให้ไปที่ start > run แล้วพิมพ์คำสั่ง eventvwr.msc เพื่อเปิดดู Log file ของการ error โดยให้ดูการ error ของ SCSI หรือ FASTFAT ในหมวด System หรือ Autochk ในหมวด Application
เมื่อ: 10 กันยายน 2006, 1406
________________________________________
15.(stop code 0X00000050)Page Fault In Nonpaged Area
สาเหตุและแนวทางแก้ไข:
อาการนี้สาเหตุการจากการผิดพลาดของการเขียนข้อมูลในแรม การแก้ไขก็ให้ทำความสะอาดขาแรมหรือลองสลับแรมดูหรือไม่ก็หาโปรแกรมที่ test แรมมาตรวจว่าแรมเสียหรือไม่
16.(stop code 0Xc0000221)Status Image Checksum Mismatch
สาเหตุและแนวทางแก้ไข:
อาการนี้สาเหตุมาจาก swapfile เสียหายรวมถึงไดร์เวอร์ด้วย การแก้ไขก็เหมือนข้อ 15
17.(stop code 0X000000EA) Thread Stuck In Device Driver
สาเหตุและแนวทางแก้ไข:
อาการของ error นี้คือการทำงานของเครื่องจะทำงานในแบบวนซ้ำๆ กันไม่สิ้นสุด เช่นจะรีสตร์ทตลอด หรือแจ้งerror อะไรก็ได้ขึ้นมาไม่หยุด ปัญหานี้ สาเหตุอาจจะเกิดจาก bug ของโปรแกรมหรือสาเหตุอื่นๆ เป็นร้อย การแก้ไขให้พยายามทำตามนี้
1.ให้ดูที่ power supply ของคุณว่าจ่ายกำลังไฟเพียงพอกับความต้องการของคอมคุณหรือไม่ ให้ดูว่าในเครื่องคุณมีอุปกรณ์มากไปไม่เหมาะกับ power supply ของคุณ ก็ให้เปลื่ยนตัวใหม่ให้กำลังมากขึ้น ปัญหานี้ผมเคยมีประสพการณ์แล้ว 2 ครั้ง คือ
2. ให้คุณดูที่การ์ดจอว่าได้ใช้ไดร์เวอร์ตัวล่าสุด ถ้าแน่ใจว่าใช้ตัวล่าสุดแล้วยังมีอาการ ก็ให้ทำการ Rollback ไดร์เวอร์ตัวก่อนที่จะเกิดปัญหา
3. ตรวจดูการ์ดจอและเมนบอร์ดว่าเสียหรือไม่เช่น มีรอยไหม้, ลายวงจรขาด มีชิ้นสวนบางชิ้นหลุดจากตำแหน่งเดิม เป็นต้น
4. ดูที่ bios ว่าส่วนของ VGA slot เลือกโหมด 4x,8x ถูกตามสเปกของการ์ดหรือไม่
5. เช็คดูที่ผู้ผลิตเมนบอร์ดว่ามีไดร์เวอร์ตัวใหม่หรือไม่ ถ้ามีให้โหลดลงใหม่ซะ
6. ถ้าคุณมีการ์ดแลนหรือเมนบอร์ดของคุณมี on board อยู่ให้ disable ฟังก์ชั่น "PXE Resume/Remote Wake Up" โดยไปปิดที่ BIOS
18. (stop code 0X0000007F) unexpected Kernel Mode Trap
สาเหตุและแนวทางแก้ไข:
อาการนี้ส่วนใหญ่จะเป็นกับนัก overclock (ผมก็คนหนึ่ง) เป็นอาการ RAM ส่งข้อมูลให้ CPU ไม่สัมพันธ์กันคือ CPU วิ่งเร็วเกินไป หรือร้อนเกินไปสาเหตุเกิดจากการ overclock วิธีแก้ก็คือลด clock ลงมาให้เป็นปกติ หรือ หาทางระบายความร้อนจาก CPU ให้มากที่สุด
19. (stop code 0X000000ED)Unmountable Boot Volume
สาเหตุและแนวทางแก้ไข:
อาการที่วินโดวส์หาฮาร์ดดิสก์ไม่เจอ (ไม่ใช่ตัวบูตระบบ) ในกรณีที่คุณมีฮาร์ดดิสก์หลายตัว หนึ่งในนั้นคุณอาจใช้สายแพของฮาร์ดดิสก์ผิด เช่น ฮาร์ดดิสก์เป็นแบบ 33MB/secound ซึ่งต้องใช้สายแพ 40 pin แต่คุณเอาแบบ 80 pin ไปต่อแทน
ที่มา http://pc-thai.net โดยคุณ Uncle
๖/๒๖/๒๕๕๐
ท่านั่งที่เหมาะสมสำหรับผู้ใช้งานคอมพิวเตอร์
การปรับเก้าอี้และท่านั่งให้เหมาะสม
นั่งให้สะโพกอยู่ชิดพนักเก้าอี้ให้มากที่สุด
ปรับความสูงของเบาะให้พอเหมาะ เพื่อให้ฝ่าเท้าวางราบไปกับพื้นได้และหัวเข่าอยู่ในระดับเดียวกันหรือต่ำกว่าสะโพก
ปรับพนักเก้าอี้ให้เอนไปประมาณ 100-110 องศา ทำให้มั่นใจว่าหลังของน้องๆทั้งส่วนบนและล่างถูกรองรับโดยพนักพิงจ้า
ปรับที่วางแขนจนรู้สึกได้ว่าไม่เกร็งไหล่
การวางคิย์บอร์ด
อย่าวางคีย์บอร์ดให้ไปเกะกะการเอื้อมหยิบสิ่งของอื่นที่อยู่รอบๆ
นั่งให้ชิดกับคีย์บอร์ด หรือไม่ก็ดึงคีย์บอร์ดมาชิดตัวน้อง
จัดให้คีย์บอร์ดอยู่ตรงกับลำตัว หรืออาจจะเป็นส่วนที่ใช้งานบ่อยที่สุด เช่น ฝั่งตัวเลข ก็เลื่อนเอาฝั่งนั้นมาให้อยู่ตรงหน้าเราพอดี
ถ้ามีที่พักฝ่ามือ ก็จะดีแต่ควรใช้เฉพาะเวลาหยุดพิมพ์เท่านั้น เราไม่แนะนำให้ใช้ระหว่างพิมพ์นะจ๊ะรวมถึงความกว้างของที่พักฝ่ามือ ไม่ควรจะกว้างเกินไปและก็ไม่ควรจะสูงกว่า space bar ของคีย์บอร์ดด้วย
ตำแหน่งของจอภาพ เอกสารต่างๆ และ เครื่องโทรศัพท์
จัดตำแหน่งของจอภาพให้อยู่ตรงหน้าน้องพอดี หรือก็คือ อยู่ตรงกับคีย์บอร์ดนั่นเอง
ปรับความสูงของจอภาพให้ ขอบบนอยู่สูงกว่าระดับสายตาเวลานั่งขึ้นไป 2-3 นิ้ว
นั่งให้ห่างจากจอภาพประมาณ 1 ช่วงแขนแล้วค่อยปรับความชัดของจอให้พอดีกัน
วางเอกสารต่างๆ เช่น ต้นฉบับที่จะพิมพ์ตาม ให้อยู่ตรงหน้าพอดี หรือก็คือ วางไว้ระหว่างคีย์บอร์ดกับหน้าจอ แต่ถ้าไม่มีที่จริงๆ สามารถวางบนที่วางเอกสารติดกับหน้าจอก็ได้
วางโทรศัพท์ให้อยู่ภายในระยะที่เอื้อมถึงได้ง่าย
เลือกใช้ headset หรือ เปิด speaker เพื่อหลีกเลี่ยงการหนีบหูโทรศัพท์ขณะพิมพ์งาน
หยุดพักซะบ้าง
หยุดพัก ผ่อนคลายกล้ามเนื้อเป็นเวลาสั้นๆ ซัก 1-2 นาทีเมื่อนั่งทำงาน (หรือนั่งเล่นเกม) ติดต่อกันนาน 20-30 นาทีแล้ว รวมถึง หยุดพัก 5-10 นาทีทุกชั่วโมง และหลีกเลี่ยงการอยู่หน้าคอมฯในเวลาพักเที่ยงด้วย
ป้องกันอาการล้าทางสายตา โดยมองไปที่อื่นไกลๆ เป็นระยะๆ
พักสายตาโดยหาอะไรมาปิดตาไว้ เช่น ฝ่ามือของน้องๆเองก็ได้ ประมาณ 10-15 วินาที
๕/๓๑/๒๕๕๐
Chinese Professor Cracks Fifth Data Security Algorithm
Chinese Professor Cracks Fifth Data Security Algorithm
SHA-1 added to list of "accomplishments"
Central News Agency | Jan 11, 2007 |
TAIPEI—Within four years, the U.S. government will cease to use SHA-1 (Secure Hash Algorithm) for digital signatures, and convert to a new and more advanced "hash" algorithm, according to the article "Security Cracked!" from New Scientist . The reason for this change is that associate professor Wang Xiaoyun of Beijing's Tsinghua University and Shandong University of Technology, and her associates, have already cracked SHA-1.
Wang also cracked MD5 (Message Digest 5), the hash algorithm most commonly used before SHA-1 became popular. Previous attacks on MD5 required over a million years of supercomputer time, but Wang and her research team obtained results using ordinary personal computers.
In early 2005, Wang and her research team announced that they had succeeded in cracking SHA-1. In addition to the U.S. government, well-known companies like Microsoft, Sun, Atmel, and others have also announced that they will no longer be using SHA-1.
Two years ago, Wang announced at an international data security conference that her team had successfully cracked four well-known hash algorithms—MD5, HAVAL-128, MD4, and RIPEMD—within ten years.
A few months later, she cracked the even more robust SHA-1.
Focus and Dedication
According to the article, Wang's research focusses on hash algorithms.
A hash algorithm is a mathematical procedure for deriving a 'fingerprint' of a block of data. The hash algorithms used in cryptography are "one-way": it is easy to derive hash values from inputs, but very difficult to work backwards, finding an input message that yields a given hash value. Cryptographic hash algorithms are also resistant to "collisions": that is, it is computationally infeasible to find any two messages that yield the same hash value.
Hash algorithms' usefulness in data security relies on these properties, and much research focusses in this area.
Recent years have seen a stream of ever-more-refined attacks on MD5 and SHA-1—including, notably, Wang's team's results on SHA-1, which permit finding collisions in SHA-1 about 2,000 times more quickly than brute-force guessing. Wang's technique makes attacking SHA-1 efficient enough to be feasible.
MD5 and SHA-1 are the two most extensively used hash algorithms in the world. These two algorithms underpin many digital signature and other security schemes in use throughout the international community. They are widely used in banking, securities, and e-commerce. SHA-1 has been recognized as the cornerstone for modern Internet security.
According to the article, in the early stages of Wang's research, there were other researchers who tried to crack it. However, none of them succeeded. This is why in 15 years hash research had become the domain of hopeless research in many scientists' minds.
Wang's method of cracking algorithms differs from others'. Although such analysis usually cannot be done without the use of computers, according to Wang, the computer only assisted in cracking the algorithm. Most of the time, she calculated manually, and manually designed the methods.
"Hackers crack passwords with bad intentions," Wang said. "I hope efforts to protect against password theft will benefit [from this]. Password analysts work to evaluate the security of data encryption and to search for even more secure … algorithms."
"On the day that I cracked SHA-1," she added, "I went out to eat. I was very excited. I knew I was the only person who knew this world-class secret."
Within ten years, Wang cracked the five biggest names in cryptographic hash algorithms. Many people would think the life of this scientist must be monotonous, but "That ten years was a very relaxed time for me," she says.
During her work, she bore a daughter and cultivated a balcony full of flowers. The only mathematics-related habit in her life is that she remembers the license plates of taxi cabs.
With additional reporting by The Epoch Times.
๔/๑๙/๒๕๕๐
Subject: Re: Visual Basic Binary file access Answered By: theta-ga on 02 Nov 2002 09:14 PST Rated: |
Reading binary data in VB is really quite easy. I'm am providing some
example code here, with pointers to articles you might refer to in
case you want more examples or explainations.
Here, I will try to read a record ExampleData from a binary file.
Since you say that you already know the binary file record structure,
you can substitute my ExampleData structure with your own record
structure.
I have included code for both VB 6 & VB 7.NET
Explaination of code snippets : I try to read/write a fixed length
record from/to a binary file.The record contains a fixed length string
of 10 chars and an integer value. I first write one record of this
type to the file and then read one record from the file in binary
mode.I also show you how to get the length of an open file in VB.
CODE SNIPPETS FOR VB5/VB6
--------------------------
'Define ExampleData structure
Type Exampledata
Name as String * 10 'This is a fixed length string of 10
characters
Age as Integer
End Type
Dim myData As ExampleData ' Declare variable of type ExampleData
...
'Open Binary File
'FOr Binary Access, The Open function has the following format :
'Open filename For Binary As filenumber
Open "c:\BinaryFile.bin" For Binary As #1
'When writing to a binary file, we use the Put statement.
'Put #FileNumber, ByteNumber, VariableName
'ByteNumber is the file pos from which we start writing the data
Put #1,,myData ' Writes mydata in file at the current position
'Close the file
Close #1
....
'Read data from the file
Open "c:\BinaryFile.bin" For Binary As #1
'To read data, use the Get function
'Get #FileNumber, ByteNumber, VariableName
'Data is read from the binary file position specified by ByteNumber
Get #1,,myData 'Read in data from the current file pos
'Print Data
Debug.Print myData.Name
Debug.Print myData.Age
'To get the length of file, use the LOF(filenumber) function
Debug.Print "Length of the Binary File = " & LOF(1)
'Close File
Close #1
RELATED LINKS
-------------
- Binary Files - File Access by James Crowley
A very good tutorial On using Binary Files under VB. Highly
recommended!
( http://www.developerfusion.com/show/85/1/ )
- MSDN Help topic: "Using Binary File Access"
The standard MS Help Article on Binary files in VB 6
( http://msdn.microsoft.com/library/devprods/vs6/vbasic/vbcon98/vbconusingbinaryfileaccess.htm
)
- MS KnowledgeBase Q257794 - HOWTO: Use Binary File Access with
Visual Basic
Adds to the above MSDN Article. Provides example code for
variable length records access in a binary file using VB.
( http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q257794&
)
- MS Support : File Access with Visual Basic® for Applications
Although for VBA, the same code works for VB6. Provides a list of
all the functions that can be used with the Binary file Access mode in
VB.Also provides example code.
( http://support.microsoft.com/default.aspx?scid=/support/excel/content/fileio/fileio.asp
)
======================
CODE SNIPPETS FOR VB7.NET
-------------------------
'Define ExampleData structure
Structure Exampledata
Name as String 'Fixed length string of 10
characters
Age as Integer
End Type
Public myData As ExampleData ' Declare variable of type
ExampleData
...
'Open Binary File
'For Binary Access, use the FileOpen function which has the form :
'FileOpen(FileNumber, FileName, OpenMode.Binary)
FileOpen (1,"c:\BinaryFile.bin", OpenMode.Binary
'When writing to a binary file, we use the FilePut() function.
'FilePut( FileNumber,VariableName)
FilePut(1,myData) ' Writes mydata in file at the current position
'Close the file
FileClose(1)
....
'Read data from the file
FileOpen (1,"c:\BinaryFile.bin", OpenMode.Binary
'To read data, use the FileGet function
'FileGet (FileNumber, VariableName)
FileGet(1,myData) 'Read in data from the current file pos
'Display length of open file using the func. LOF(filenumber)
Debug.WriteLine(LOF(1))
'Close File
FileClose(1)
RELATED LINKS
-------------
- MSDN VB.NEt File Functions Reference
- FileOpen()
( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vastmopen.asp
)
- FilePut()
( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vastmput.asp
)
- FileGet()
( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctget.asp)
- LOF()
( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctlof.asp
)
MSDN Article : Binary File Access
( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vaconopeningfileforbinaryaccess.asp
)
===========================
I hope the above answer will satisfy your needs.
If you need any clarifications, just ask.
Till the, Happy Coding !
:)
๓/๑๗/๒๕๕๐
เผยเด็กไทย 6-14 ปีใช้คอมฯ สูง 57% แซงวัยทำงาน
ทั้งนี้ ผลการสำรวจระบุว่าประชากรกลุ่มอายุ 6-14 ปี มีอัตราการใช้คอมพิวเตอร์สูงสุด 57% รองลงมาคือกลุ่มอายุ 15-24 ปี อัตรา 50.4% และกลุ่มอายุ 25-34 ปี อัตราส่วน 22.4%
ส่วนอัตราการใช้อินเทอร์เน็ตพบว่า กลุ่มอายุ 15-24 ปีเป็นกลุ่มที่มีการใช้อินเทอร์เน็ตสูงสุด สัดส่วน 36.5% รองลงมาคือกลุ่มอายุ 6-14 ปี และกลุ่มอายุ 25-34 ปี มีอัตราการใช้อินเทอร์เน็ตใกล้เคียงกันคือ สัดส่วน 15.5% และ 15.2% ตามลำดับ
จากประชากรกลุ่มอายุ 6-14 ปี จำนวน 8.97 ล้านคน พบว่ามีเด็กที่ใช้คอมพิวเตอร์สูงถึง 5.11 ล้านคน และใช้อินเทอร์เน็ต 1.39 ล้านคน สำหรับกลุ่มอายุ 15-24 ปี จำนวน 10.55 ล้านคน มีจำนวนผู้ใช้คอมพิวเตอร์ 5.32 ล้านคน และใช้อินเทอร์เน็ต 3.85 ล้านคน ขณะที่กลุ่มประชากรวัยทำงาน 25-34 ปี จำนวน 10.79 ล้านคน มีสัดส่วนที่ใช้คอมพิวเตอร์เพียง 2.42 ล้านคน และใช้อินเทอร์เน็ต 1.64 ล้านคน
โดยจากข้อมูลพบว่าสถานศึกษาเป็นแหล่งที่มีผู้ใช้คอมพิวเตอร์และอินเทอร์เน็ตสูงสุดคือ 48.3% และ 39.9% รองลงมาคือการใช้คอมพิวเตอร์และอินเทอร์เน็ตจากที่บ้าน 28.6% และ 25.9% ขณะที่การใช้คอมพิวเตอร์และอินเทอร์เน็ตจากที่ทำงาน 20.5% และ 24.4% ตามลำดับ สำหรับการใช้อิน เทอร์เน็ตจากร้านอินเทอร์เน็ตคิดเป็นสัดส่วน 8.6%
เมื่อพิจารณาถึงแหล่งของผู้ใช้คอมพิวเตอร์และอินเทอร์เน็ตตามกลุ่มอายุ พบว่าประชากรอายุ 6-14 ปีที่มีอัตราการใช้คอมพิวเตอร์สูงถึง 57% ส่วนหนึ่งเป็นเพราะใช้คอมพิวเตอร์จากสถานศึกษาถึง 78.9% รวมถึงกลุ่มอายุ 15-24 ปีก็ยังเป็นการใช้คอมพิวเตอร์และอินเทอร์เน็ตจากสถานศึกษาถึง 61.5% ขณะที่ผู้มีอายุตั้งแต่ 25 ปีขึ้นไปส่วนใหญ่เป็นการใช้งานจากที่ทำงาน 50-57%
นอกจากนี้ โครงการดังกล่าวยังได้สำรวจถึงการมีและการใช้อุปกรณ์เทคโนโลยีสารสนเทศในครัวเรือน โดยจากจำนวนครัวเรือนทั้งสิ้น 18.06 ล้านครัวเรือน มีครัวเรือนที่มีเครื่องโทรศัพท์พื้นฐาน 4.22 ล้านครัวเรือน (23.4%) เครื่องโทรสาร 2.68 แสนครัวเรือน (1.5%) คอมพิวเตอร์ 3.08 ล้านครัวเรือน (17.1%) และครัวเรือนที่มีการเชื่อมต่ออินเทอร์เน็ต 1.3 ล้านครัวเรือน (7.2%) โดยในเขตกรุงเทพฯมีจำนวนครัวเรือนที่มีอุปกรณ์เทคโนโลยีสารสนเทศมากที่สุด และภาคตะวันออกเฉียงเหนือมีจำนวนครัวเรือนที่มีอุปกรณ์รวมทุกประเภทน้อยที่สุด
จากจำนวนครัวเรือนที่มีการเชื่อมต่ออินเทอร์เน็ต 1.3 ล้านครัวเรือน พบว่าในเขตกรุงเทพฯมีจำนวนครัวเรือนที่เชื่อมต่ออินเทอร์เน็ตสูงถึง 63% รองลงมาคือภาคใต้และภาคกลางมีอัตราใกล้เคียงกันคือ 41.2% และ 39.9% ตามลำดับ ส่วนภาคเหนือมีครัวเรือนที่เชื่อมต่ออินเทอร์เน็ต 35.7% และภาคตะวันออกเฉียงเหนือมีครัวเรือนที่เชื่อมต่ออินเทอร์เน็ตน้อยที่สุดคือ 24.5%
โดยการสำรวจเก็บข้อมูลการมีการใช้เครื่องมือ/อุปกรณ์เทคโนโลยีสารสนเทศ (ครัวเรือน) เป็นการสำรวจกลุ่มตัวอย่างทั้งสิ้น 79,560 ครัวเรือน ในช่วงเดือน ส.ค.-ก.ย. พ.ศ.2549 แหล่งข่าวในอุตสาหกรรมไอซีทีแสดงความเห็นว่า แม้อัตราการเติบโตของตลาดไอทีจะมีต่อเนื่อง แต่จากข้อมูลอัตราการมีคอมพิวเตอร์ต่อครัวเรือนอยู่ที่ 17 เครื่อง/100 ครัวเรือน ซึ่งถือว่าต่ำมาก
สำนักงานสถิติก็เคยสำรวจสัดส่วนของผู้มีคอมพิวเตอร์ต่อประชากรของประเทศ ซึ่งจะอยู่ที่ 7-8% เท่านั้น คือประชากร 100 คน มีคอมพิวเตอร 7-8 คนเท่านั้น ต่ำมากเมื่อเทียบกับการมีโทรศัพท์มือถือ หรือเทียบกับประเทศเพื่อนบ้าน เนื่องจากการเติบโตของตลาดไอทีภาคครัวเรือนของไทยยังเป็นแบบค่อยเป็นค่อยไป ไม่ได้รับการสนับสนุนหรือผลักดันจากภาครัฐเหมือนเช่นประเทศเพื่อนบ้าน อย่างไรก็ตามในแง่ธุรกิจก็ถือว่าตลาดเมืองไทยยังมีแนวโน้มและโอกาสการเติบโตอีกมากโดยเฉพาะในตลาดต่างจังหวัด
๓/๐๘/๒๕๕๐
Making the space and time for strategic thinking
Making the space and time for strategic thinking
I have found myself being pulled in about a thousand directions the last couple of weeks and the song, “That old familiar feeling” seems to be haunting me. I know where I need to be focused, but lately I find myself being dragged back into fighting fires–a management mode I usually try to avoid. This is a problem that many small IT shops face as well as overtaxed large ones. There never seems to be enough time in the day, and the work that falls off the list first is planning, strategizing, and documenting.
I find myself carrying around way too much information in my head, not sharing info until it is asked for, and feeling like I need to make the world stop in order to catch up. I am not as current as I would like to be on my technical reading, and my to-do list never seems to shrink. Who can I blame? While I would like to blame the world around me, the fact of the matter is, I am at fault and I need to take control again.
So where do I start? Well the first thing I need to do is to make sure I don’t beat myself up over having lost control–we all do it sometimes–and I am not going to feel sorry for myself either. Nor am I going to be Superman and swallow the stress associated with it and drop dead of a heart attack. I am going to pause and reflect.
How do I do that? First, I stop responding to all the stimuli that I am bombarded with and refocus on what is important. I can do this in several ways.
A famous management professional once said that the most successful executives worked outside of the office one day a week. This gives you a way to step back from the flames and work in an environment that is more conducive to thought.
Outside the office doesn't necessarily mean at "home" (especially for some people, who have just as many distractions there). It usually works for me because I have a nice office set up at home, I do not have children, and except for when the dog is barking, the house is totally silent other than the whir of my PCs.
Unfortunately, home is not an option for me at the moment. Plan B is to make a quiet space at the office. I have a door I can close and a new administrative assistant who can take my calls. So while I have a harder time getting into that Zen-like zone in a place that I often associate with being out of control–this is how it is going to have to be.
For those that are cube-bound and can’t work from home, you are forced to be more creative. Coming in early and staying late–when there are fewer distractions in the workplace–are common options, but many of you may already be doing that. So what then? Try to find a space at your workplace that is out of the way–an unused conference room or an empty office on a different floor. As a last resort, you may have to put up a "do not disturb" sign and get yourself a set of noise-canceling headphones to create a virtual quiet place for yourself. If you want to do it, you will find a way. Hey you are IT–you know how to work around obstacles!
Once you have found your space, make a meeting with yourself. Call it what you need to call it, but block the time out and use it. An hour will do as a minimum in my opinion; two is probably optimal. Now comes the hard part. Make this a sacred time that you do not want violated and communicate it to everyone– and here’s the hardest part–you also have to stick to it yourself. You know the difference between real emergencies and those that seem like emergencies. Respond only to the real if you absolutely have to and you are the only one who can fix it.
Now that you've created space and time for yourself, exactly what are you going to do in it? My advice is to first use your time to sort and prioritize. What’s important, what can wait, what do you NEED to do and what would you LIKE to do? Plan, read, write things down. Most importantly, use the time to think strategically. Stop and examine all those fires that you've been fighting and determine if there is a common theme behind them, and work on that solution.
Use the time to think outside the box. Are you taking total responsibility for problems that are a shared responsibility? Communicate. Close the loop. Follow up. Examine your tasks using different views–put on the different “thinking” hats championed by Edward de Bono (http://www.debonogroup.com/serious_creativity.htm).
The point is to take control, because the workplace actually pushes you in the opposite direction if you let it. The old phrase, "Lack of planning on your part does not constitute an emergency on my part,” dies a quick death in the workplace. People will try to make EVERY problem yours if you let them–and lack of planning is usually the reason it is an emergency in the first place (at least in their minds). So take the time to commit or re-commit to being a planner and try the steps above. It will make you work better and smarter in the long run and hopefully relieve some stress.
Lastly, don’t beat yourself up if you get a little bit out of control. It happens. Just remember that when you are feeling the most stressed and whacked out, that is probably the opportune time to take a time out to pause and reflect.
from: http://blogs.techrepublic.com.com/tech-manager/?p=279&tag=nl.e106