-
Similar Content
-
By Chuki2
Assalamualaikum, sementara tengah bosan-bosan kat opis nie. Boleh lah buat kelas mengenai C# bersama user putera.com. :D
Sebelum kita mula ke sesi pembelajaran, jom kita mengenali apa itu C#.
- C# pertama kali release adalah pada january 2002
- C# adalah seperti bahasa C, C++ dan JAVA. Dari segi command, syntax dan function lebih kurang sama.
- C# berkonsepkan object oriented, sama seperti VB.NET dan Java.
- Sekiranya anda merasakan lebih mudah faham C++ atau JAVA, maka C# adalah bahasa yang sesuai untuk anda pelajari.
Dalam pelajaran kali ini, kita akan menguna Integrated Development Environment (IDE - Dalam bahasa mudah software untuk membina aplikasi) iaitu Visual Studio 2010. Jadi sesiapa lagi belum ada, boleh didownload dari SINI
Untuk cara INSTALL, sila rujuk link video dibawah :
http://www.youtube.com/watch?v=9TIiIOtle64
SUBJECT 1 :
Sila create project baru
FILE > ADD NEW PROJECT > WINDOWS > WINDOWS FORMS APPLICATION
Kemudian namakan project yang sesuai.
.......bersambung, bos panggil kerja balik... hampeh
-
By NeoLogy
Salam,
Aku nak create satu function yang akan check size file. Aku tak perlukan size file yang sebenar kerana function ni cuma perlu check adakah file tersebut lebih besar daripada size yang ditetapkan atau tidak. Ideanya begini; function ni akan read file ni by chunck of data. Let say file tu bersize 1GB. Kalau gunakan GetFileSize(), sudah tentu mengambil masa yang lama untuk dapatkan size file tersebut. Ini akan merugikan masa kerana aku hanya perlu tahu adakah file tersebut bersize lebih daripda 10MB?
Kalau file lebih daripada 10MB, function akan return true dan return false kalau kurang daripada 10MB. Dengan membaca file by chunck, let say 1024byte on each chunck, kalau total read chunck size lebih daripada 10MB, then automatically return true tanpa perlu baca chunck seterusnya.
So, nak tanya macam mana nak read file by chunck?
Kalau ada contoh, lagi bagus. Atau kalau ada mana-mana references ke..
-
By saya nurul
salam,
saya create login page dlm c# dan mysql database, dan saya hadapi masalah untuk hantar user(customer, admin) ke homepage berlainan selps login. Ni koding yang sya tlh buat, tp still ad error. harp ada yg boleh membntu sya..
terima kasih
-----------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using MySql.Data.MySqlClient;
using System.Data;
using System.Text.RegularExpressions;
namespace WebApplication6
{
public partial class logmasuk : System.Web.UI.Page
{
public DbConnection connection;
string sqlQ;
DataSet myData;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
bool closeConn;
MySqlDataReader myData;
sqlQ = "SELECT userType FROM login WHERE ic='" + TextBoxnp.Text.ToString() + "' AND pass ='" + TextBoxkl.Text.ToString() + "'";
DbConnection myDB = new DbConnection();
//myData = myDB.Retrieve(sqlQ, "login");
myData = connection.RetrieveDR(sqlQ, "login");
while (myData.Read())
{
if (myData.GetString("userType").Equals("3"))
{
Response.Redirect("adminHome.aspx?Id=" + this.TextBoxnp.Text);
}
else if (myData.GetString("userType").Equals("2"))
{
Session["ic"] = TextBoxnp.Text;
Response.Redirect("userHome.aspx?Id=" + this.TextBoxnp.Text);
}
else
{
Response.Redirect("logmasuk.aspx");
}
}
//myData.Close();
//closeConn = connection.CloseConnection();
}
}
}
-
By orance
saya tak tahu macam mana nak buat coding untuk validation password. dia ada 1 button sahaja iaitu button sign in pada interface. hanya 2 user sahaja yang dibenarkan sign in dan interface akan memaparkan gambar user yang log in....
This program only allows two users to sign-in which means, we have to set the username and password in the program itself.
User1
Username: Felix
Password: sand
User 2
Username: Hendry
3
Password: flower
4. Use If…else if statements to verify which user is signing in.
5. When the user clicks the button Sign In, it will prompt user to enter the first name.
(Set in your program the username is “Felix”).
6. After entering the first name, it will prompt again asking for password.
(Set in your program the password is “sand”).
If the user entered the correct values for first name and password, it will display the message box greeting the user’s name as follow
"hello felix!Ready to play
-
By merahPutih
[color=#0000cd]Hi,
Nak mintak pendapat korang sket~~
Source code ni aku dapat dari programmer lame (ni file DLL).
Dia gune dll ni kat app dier dan stakat ni aku tengok cam ok.
ni sourcecode tu[/color]
[code]Private Sub SendToPort(ByVal code As String)
Dim logstr2 As String = ""
Dim ByteSend(16) As Byte
Dim str As String
Dim strArray() As String = code.Split("#")
Dim k As Integer
Dim l As Integer
Dim dataSize As Integer
Try
logstr2 = "1"
gCount = UBound(strArray) + 1
logstr2 = "2"
dataSize = gCount + 5
logstr2 = "3"
ByteSend(0) = 2
logstr2 = "4"
ByteSend(1) = 3
logstr2 = "5"
ByteSend(2) = dataSize
logstr2 = "6"
ByteSend(3) = strArray(0)
logstr2 = "7"
If gCount > 1 Then
l = 0
For k = 4 To (UBound(strArray) + 3)
l = l + 1
ByteSend(k) = strArray(l)
Next k
End If
logstr2 = "8"
str = CheckSum("#B#C#" & dataSize & "#" & code)
logstr2 = "9"
ByteSend(gCount) = Asc(Mid(str, 1, 1))
logstr2 = "10"
ByteSend(gCount + 1) = Asc(Mid(str, 2, 1))
logstr2 = "11"
Log_Rtn("gCount = " & gCount.ToString & vbNewLine & "logstr2 = " & logstr2)
cv.Write(ByteSend, 0, gCount + 2)
logstr2 = "12"
Dim bolWait As Boolean
bolWait = Wait_Fnc()
logstr2 = "13"
tmpRev1 = ByteSend(gCount + 1)
logstr2 = "14"
Catch ex As Exception
Log_Rtn("clsB2B|SendToPort|" & ex.Message & logstr2 & "," & gCount & "," & code)
End Try
End Sub[/code]
[color=#0000cd]jadi masalah aku ialah bile aku GO(F5), Result yang aku dapat salah, bile aku letak breakpoint lpastu step into (F10), baru dapat result yang aku nak[/color]
[color=#0000cd]Breakpoint tu aku letak kat sini[/color]
[CODE]
bolWait = Wait_Fnc()
[/CODE]
[color=#0000cd]ni Wait_Fnc()[/color]
[color=#333333][CODE]
Private Function Wait_Fnc() As Boolean
intWaitLoop = 0
tmrWait.Enabled = True
Do While tmrWait.Enabled = False
'Do Nothing[/color]
[color=#333333]Return False
End Function
[/CODE][/color]
[color=#0000ff]aku pakai visual studio 2008
ape yang ak dapat dari google, dorg suruh pastikan semua variable dah initialize , build mode = debug[/color]
[color=#0000ff]then aku try- still prob yang same
kalau build mode = release pun same jugak[/color]
[color=#0000ff]sekarang ni aku pakai [/color][color=#0000FF]build mode = debug[/color]
[color=#0000FF]ade gak yang swh pakai [/color][color=#0000FF]application.doevents, yang ni aku x dapat try (maybe pasal ni class??? )[/color]
[color=#0000ff]so aku nak mintak pendapat korang,
rase2 nye kenape ak dapat result macam ni?? ade lagi mane2 setting yang aku perlu buat ke??[/color]
-