Posted by Junkie
on Saturday, February 27, 2010 10:40 PM
If you cannot access the properties or methods of the Form1 of the type System.Windows.Forms.Form , try this. to access the properties and methods.
e.g,
this.Text="Skynet Application";
this.Enabled=false;
a0d29cb5-bc42-4abd-83ae-2df3c62c94b6|0|.0
Posted by Junkie
on Tuesday, November 10, 2009 12:24 AM
to be completed….
fa90db9d-97d5-4338-b102-6c40049f81e1|0|.0
Posted by Junkie
on Tuesday, November 10, 2009 12:21 AM
I had to find a mail server software I could use with my C# code. I found the following potential software after a quick search.
1. Exchange Server
2. hMail Server
3. MailEnable
4. SendMail
5. Windows POP3 Service (didn't have high hopes on this one, but you never know)
Since I didn't have enough time to research this list more closely, please take my conclusion with a pound of salt! Based on my quick research I found that hmail and send mail didn't have an API I could use with C# and I think MailEnable had C# API available for paid versions (or it could be SendMail). When I started to install Exchange Server I quickly found out I will need an AD without which I would not be able install it.
While installing Exchange server I decided to give Windows POP3 server a try and sent out an email to my personal email addresses using for example austinpowers@groovybaby.com (say www.groovybaby.com is my department's domain). I received the emails which I expected to work. Now the real tes...
[More]
ac9d622c-cef0-430f-a4ff-6bad1a34b70c|0|.0
Posted by Junkie
on Monday, November 09, 2009 8:57 PM
Problem:
As stated in the previous article I had to write code to send bulk emails with a 6MB PDF attachments individually. The source of the email body was from a .htm template file which had references to images such as the company logo and others. This email should also have an alternate plain text format in case the recipient's email client accepted only plain text email.
Solution:
The code is pretty simple and straight forward. We will be using the following classes from .NET MailMessage, EmbeddedMailObject, MailDefinition, MailAttachment and SMTPClient.
C# Code
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Web.UI.WebControls;
namespace Mail_CA01
{
class Mail
{
// folder where this console application will reside
public static string directory = @"C:\SendMail";
public static void SendMail()
{
try
{
// read all the email addresses stored in this text f...
[More]
7233a076-105e-447c-85fc-36be0792409e|0|.0
Posted by shariff
on Monday, November 09, 2009 8:41 PM
At a short notice I had to use C# to send out bulk emails to a few thousand recipients. Of course short notice is not the problem of the problem. To keep things interesting I couldn't use our company's Exchange Server and the domain email address, which would have been straight forward. All I would have to do is write code to send emails through this server. But that was not going to happen. I had to use our department's domain name which is different from the company and there were no email servers setup nor were there any email addresses created for this domain. So the problem is four fold.
1. Write C# code to send individual html formatted emails with a plain text option, from a html template file with images in the email and a 6MB PDF attachment to boot.
2. Setup a server and find viable mail server software to create email addresses, send and receive emails for the domain in question.
3. Set up the DNS entries including the MX records and SPF record to avoid the emails being re...
[More]
be631580-3deb-4fa0-8dd6-018b19cc141e|0|.0
Posted by Junkie
on Wednesday, November 04, 2009 5:29 PM
To correct this go to Settings –> Basic Settings. Change ‘Server time offset’ to the appropriate value.
6658cf80-c91a-4a61-8ba7-35e6707749a1|0|.0
Posted by Junkie
on Wednesday, November 04, 2009 3:49 PM
Microsoft is offering free 5GB storage with Office Live and 25GB with Sky Drive. Of course you need a Windows Live ID or Hotmail. You can keep your files private, public or share them with people you choose. You can upload almost any type of file with few exceptions. The current upload capacity per file is 50MB. With Office Live Update, you can access your online documents directly from Office applications. Apparently they have been offering this for a while and I was totally unaware of this. I must have been living in a cave.
625f3185-6b49-4ee0-8e00-c34aa968d55c|0|.0
Posted by Junkie
on Wednesday, November 04, 2009 3:31 PM
If you use nchar(n) for a column, say n=5 and the length of the string you enter for this column is 3. MS SQL adds whitespace to this string to make it 5 characters long. Be mindful of that, this can break a DropDownList when you try to assign this string as the SelectedValue and the dropdownlist is pre-populated manually or from a different source. I of course learnt this the hard way after spending considerable time.
8b60d88b-92b6-4445-8414-efc2b912019a|0|.0
Posted by Junkie
on Wednesday, November 04, 2009 3:16 PM
I recently had to use the detailsview with my custom object ‘Subscriber’ which had a property ‘Subscription’ of type enum. I ran into a problem when inserting / updating this object. During this operation I received the error ‘Objectdatasource couldnt find a non-generic method….’ .I used the Objectdatasource to bind the ‘Subscriber’ object to the Detailsview. When I did this, the Detailsview didn't not automatically generate the column for the enum property ‘Subcription’, but the ObjectDataSource’s parameters list had this enum listed, I had to manually add this property as a column. After spending sometime I found the solution, which I have presented below.
Enum:
public enum Subscription
{
Unsubscribed,
New,
Subscribed
}
Custom Object:
[DataObject]
public class Subscriber : BusinessObject
{
private int _subscriberID = 0;
publ...
[More]
2be02534-3cb2-45ff-911e-ecd34d3eafb4|0|.0
Posted by Junkie
on Wednesday, November 04, 2009 3:14 PM
I finally decided to have my own blog and chose Blogengine.net as my blog platform. It would be apt for my first blog to be about Blogengine.net. In this blog I will briefly outline the steps I took to install it on Godaddy hosting.
Environment:
Blog platform: BlogEngine.NET 1.5 Final (Download the BlogEngine.NET 1.5 (web) version)
DataProvider: MS SQL 2005
Hosting: GoDaddy Deluxe Account
FTP Client: FileZilla – Its Free!
Code Highlighter:
SyntaxHighlighter 2.0
BE.NET Extension
Windows Live Writer Extension
Installation:
BlogEngine.NET
1. Download and unzip the contents of BlogEngine.Web.zip.
2. Edit the robots.txt, remove the ‘#’ from the last line and replace the text ‘http://example.com/sitemap.axd ’ with your website, add ‘www.’ if you would like. In my case it is ‘http://www.dotnetjunkie.com/sitemap.axd’.
3. Go to your GoDaddy Hosting account and go to Content –> IIS Management. Maks...
[More]
28c38e00-b00c-496d-880a-d6a16c1c06f2|0|.0