Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > .NET Framework > Forum > ตัวอย่าง array 2 มิติ C#...อยากได้ตัวอย่างการใช้งาน array 2 มิติ บน C# ไว้เก็บค่า String



 

ตัวอย่าง array 2 มิติ C#...อยากได้ตัวอย่างการใช้งาน array 2 มิติ บน C# ไว้เก็บค่า String

 



Topic : 027471



โพสกระทู้ ( 69 )
บทความ ( 0 )



สถานะออฟไลน์




อยากได้ตัวอย่างการใช้งาน array 2 มิติ บน C# ไว้เก็บค่า String ต่าง ๆ ครับ



Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2009-05-19 12:08:49 By : Gg View : 43771 Reply : 6
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Code (C# & Array 2 มิติ)
string[,] MyArr = new string[2,3];
MyArr[0,0] = value;
MyArr[0,1] = value;
MyArr[0,2] = value;
MyArr[0,3] = value;
MyArr[1,0] = value;
MyArr[1,1] = value;
MyArr[1,2] = value;
MyArr[1,3] = value;
MyArr[2,0] = value;
MyArr[2,1] = value;
MyArr[2,2] = value;
MyArr[2,3] = value;

int i = 0;

for(i=0;i<=MyArr.GetLength(0);i++)
{
	Console.WriteLine(MyArr[i,0]);
	Console.WriteLine(MyArr[i,1]);
	Console.WriteLine(MyArr[i,2]);
	Console.WriteLine(MyArr[i,3]);
}







Date : 2009-05-19 15:09:21 By : webmaster
 


 

No. 2



โพสกระทู้ ( 69 )
บทความ ( 0 )



สถานะออฟไลน์


ไปเจอบทความมาน่าสนใจมากครับ

Code
using System;

class Program
{
    static void Main()
    {
        // A
        // Basic array length example.
        int[] arrayA = new int[5];
        int lengthA = arrayA.Length;
        Console.WriteLine(lengthA); // Writes 5

        // B
        // Long array length example.
        long longLength = arrayA.LongLength;
        Console.WriteLine(longLength); // Writes 5

        // C
        // Zero length array example.
        int[] zero = new int[0];
        int lengthZero = zero.Length;
        Console.WriteLine(lengthZero); // Writes 0

        // D
        // Null array length example exception.
        // int[] dead = null;
        // Console.WriteLine(dead.Length);

        // E
        // GetLength 0 example.
        int lengthE = arrayA.GetLength(0);
        Console.WriteLine(lengthE); // Writes 5

        // F
        // GetLength 1 example exception.
        // int lengthF = arrayA.GetLength(1);
        // Console.WriteLine(lengthF);

        // G
        // Two-dimensional GetLength example.
        int[,] two = new int[5, 10];
        Console.WriteLine(two.GetLength(0)); // Writes 5
        Console.WriteLine(two.GetLength(1)); // Writes 10

        // H
        // Two-dimensional Length example.
        Console.WriteLine(two.Length); // Writes 50
    }
}

Date : 2009-05-19 15:12:22 By : Gg
 

 

No. 3

Guest


Code (C#)
// initialize an array of integer type
int[] a = { 1, 5, 10, 15, 20 };

// foreach (type variable in expression)
foreach (int b in a)
{
    Response.Write(b + "<br />");
}

Date : 2011-06-29 10:50:00 By : สวย
 


 

No. 4

Guest


โปรแกรมนี้มีไว้ทำอะไรช่วยบอกทีคับ



Code
// 1.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <stdio.h> int main(void) { int a[3][4],r,c; for(r=0; r<=2; r++) for(c=0;c<=3;c++) { printf("Entry Number"); scanf("%d",&a[r][c]); } for(r=0; r<=2; r++) for(c=0;c<=3;c++) { printf("\n Display"); printf("%d",a[r][c]); } scanf("%d",&a); return 0; }

Date : 2012-01-21 19:03:41 By : ปึกแป่นปีก
 


 

No. 5

Guest


รบกวนสอบถามเรื่อง picturebox หน่อยค่ะ
กำหนด picturebox 4 อัน ให้เป็น control picturebox แล้วต้องการ เช็คค่าว่างใน picturebox ของแต่ละ picturebox ถ้า picturebox ไหนมีค่าว่าง ให้แสดงข้อความบอกว่า เป็น picturebox นั้นว่าง
Date : 2015-11-11 15:05:27 By : taew
 


 

No. 6



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ทุกวันนี้ Array ไม่ค่อยได้รับความนิยมแล้วครับ เค้าหันไปใช้ List(T) กันหมด
Date : 2015-11-11 16:44:05 By : mr.win
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ตัวอย่าง array 2 มิติ C#...อยากได้ตัวอย่างการใช้งาน array 2 มิติ บน C# ไว้เก็บค่า String
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 03
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่