Jayce Ooi’s Paradise

Photography, programming, technology, finance, anything =)
Subscribe to Jayce Ooi's Paradise feeds

Hope this will help. :)

int i = 10;
TextBox1.Text = Convert.ToString( i );

Related topics:
Convert string to boolean - C# source code

Below is the source code that will send email with attachment.

using System.Net.Mail;

MailMessage oMsg = new MailMessage();
oMsg.From = new MailAddress(”Email”, “Name”);
oMsg.To.Add(new MailAddress(”Email”,”Name”));
oMsg.Subject = “subject”;
oMsg.Body = “Mail contain”;
Attachment data = new Attachment(”File1″);
oMsg.Attachments.Add(data);

SmtpClient c = new SmtpClient(”SMTP”);
c.Send(oMsg);
oMsg.Dispose();

I have been facing problem with cannot delete my attachment from source. After troubleshooting, I found out that I forgot to put oMsg.Dispose(). Make sure you do so. :P
Related topics:
Email chinese character - C# source code

Why I cannot make the newline work properly in TextBox with Multiline property enabled already? Shouldn’t “\n” mean newline?

If I use
TextBox = “First line. \n Second line.”;
but result is
First line. Second line.

Try to use
TextBox = “First line. \r\n Second line.”;
then you will get what you want
First line.
Second line.

Remember to use “\r\n” on TextBox in windows application. :)

This is windows application code. It will auto delete all the folders in the selected path but exclude those list in the defined text file. Before it delete, it will make a copy to backup folder. However, backup folder will be deleted upon this application start.

using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

(more…)

Feeling tired / cannot finish to read the entire source code. Here are some guide that I always follow when I need to change other’s code in a very short time.

  • Define what is the changes that needed.
  • Read the affected module source code only.
  • Find a similar part or variable that you want to change. Then add/change it.
  • Always compile the code after small changes.

Example…
I have to upgrade other left over web application. No one is going to enhance it. Therefore, I am the one that have to do all the dirty work. The requirement is to skip some steps to ease user from repeat doing the same task. Product configuration page need to change to adapt this function - FastTrack. Therefore, product configuration database also need to be changed. I search a related variable such as testLib. I added FastTrack as checkbox just beside it in the source code and database for several pages. Used ‘find in files’ to search for testLib. It will show all the pages that testLib there. I added in FastTrack in those pages. Then off for trial run.

« Older Entries  Newer Entries »

Page 9 of 10« First...«678910»

Archives

Chat Chat Chat...



SP Blogger


Isabell Online Penang Florist

Isabell Online Penang florist


Recent Comments

Top Commentators