Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

angels777

@angels777
About
Posts
85
Topics
44
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • send email
    A angels777

    i am new to vb.net. i would like to create a class for sending emial . i tried the script online but i failed to send. So i got this code below from the hosting server. May i know how do i simplify the below script to just receive FromEmail, Subject, Message ? why it needs the mailerpath?mailerport? and errText? isn't we can check those error in the form instead of class ? Please kindly advice. thanks <pre> ' **** MailerPath = Your SMTP path (for eg: mail.[domain].com) *** function CDOSYS_Mailer(Message, FromEmail, ToEmail, FromName, ToName, Subject, MailerPath, MailerPort, errText, searchURL) on error resume next dim Mailer set Mailer = server.createobject("CDO.Message") if err.number <> 0 then errText = displayError("CDOSYS", searchURL, err.Number, err.Source, err.Description) CDOSYS_Mailer = false : set Mailer = nothing : err.clear() : err = 0 exit function end if Mailer.From = FromName & " <" & FromEmail & ">" Mailer.To = ToName & " <" & ToEmail & ">" Mailer.TextBody = Message Mailer.Subject = Subject with Mailer.Configuration .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = MailerPath .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = MailerPort .Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")=1 .Fields("http://schemas.microsoft.com/cdo/configuration/sendusername")="test@yourdomain.com" .Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword")="youremailpassword" .Fields.Update end with Mailer.Send if err.number <> 0 then errText = displayError("CDOSYS", searchURL, err.Number, err.Source, err.Description) CDOSYS_Mailer = false : set Mailer = nothing : err.clear() : err = 0 exit function end if set Mailer = Nothing CDOSYS_Mailer = true end function</pre>

    Visual Basic question csharp com sysadmin

  • send email
    A angels777

    i am new to vb.net. i would like to create a class for sending emial . i tried the script online but i failed to send. So i got this code below from the hosting server. May i know how do i simplify the below script to just receive FromEmail, Subject, Message ? why it needs the mailerpath?mailerport? and errText? isn't we can check those error in the form instead of class ? Please kindly advice. thanks

    ' **** MailerPath = Your SMTP path (for eg: mail.[domain].com) ***

    function CDOSYS_Mailer(Message, FromEmail, ToEmail, FromName, ToName, Subject, MailerPath, MailerPort, errText, searchURL)
    on error resume next

    dim Mailer
    set Mailer = server.createobject("CDO.Message")
    if err.number <> 0 then
    errText = displayError("CDOSYS", searchURL, err.Number, err.Source, err.Description)
    CDOSYS_Mailer = false : set Mailer = nothing : err.clear() : err = 0
    exit function
    end if

    Mailer.From = FromName & " <" & FromEmail & ">"
    Mailer.To = ToName & " <" & ToEmail & ">"
    Mailer.TextBody = Message
    Mailer.Subject = Subject
    with Mailer.Configuration
    .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = MailerPath
    .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = MailerPort
    .Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")=1
    .Fields("http://schemas.microsoft.com/cdo/configuration/sendusername")="test@yourdomain.com"
    .Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword")="youremailpassword"
    .Fields.Update
    end with
    Mailer.Send
    if err.number <> 0 then
    errText = displayError("CDOSYS", searchURL, err.Number, err.Source, err.Description)
    CDOSYS_Mailer = false : set Mailer = nothing : err.clear() : err = 0
    exit function
    end if
    set Mailer = Nothing
    CDOSYS_Mailer = true
    end function

    Visual Basic question csharp com sysadmin

  • regex
    A angels777

    public bool IsInteger(string sender) { Regex regex = new Regex("[^0-9]"); return !regex.IsMatch(sender); } hi i get confused with the code above... why when i put e.g. 333 as the sender.. regex.IsMatch(sender); this is returning false ?? and i must put a ! there ?? my logic is .. when regex[^0-9] = integer then it must return true... pls advice

    C# regex question

  • how to get the correct code
    A angels777

    thanks for the wonderful reply... BUT .. i just cant get the $#&(#$ manager Error 3 The name 'ConfigurationManager' does not exist in the current context i had put the below script in the constructor as what u told..also added the using System.Configuration;

    this.connectionString = ConfigurationManager.AppSettings["connectionString"];

    but just no manager come out..

    C# help tutorial question workspace

  • how to get the correct code
    A angels777

    i declare under this.. as global.. i do not want each function declare that.. namespace ttt { public class Dataaccess { private string sqlString = System.Configuration.ConfigurationSettings.AppSettings["connectionString"].ToString(); private SqlConnection cn;

    C# help tutorial question workspace

  • how to get the correct code
    A angels777

    yes.. i had added.. the using System.Configuration but still don have the manager thing.

    C# help tutorial question workspace

  • how to get the correct code
    A angels777

    after included i cant find the COnfigurationManager also ... system.configuration. only have .ConfigurationSettings and .ConfigurationException

    C# help tutorial question workspace

  • how to get the correct code
    A angels777

    may i know how to clear this error ? i tried use this System.Configuration.ConfigurationManager.AppSettings' but i canot find the .configurationManager.. private string sqlString = System.Configuration.ConfigurationSettings.AppSettings["connectionString"].ToString(); Warning 2 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings'

    C# help tutorial question workspace

  • doing validation in other file.cs
    A angels777

    Thank for the reply.. can u pls show some example to get all verification done is the class ? or at least guide me on declaring or passing the e thanks

    C# design help question

  • doing validation in other file.cs
    A angels777

    hi i would like to seperate my design page from validation. so i put the validation code in e.g validate.cs design form

    private void textboxInteger_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
    {
    validate.txtIntValidate(txtPhone.text)
    }

    in my validate class

    class Validate
    {
    public bool txtIntValidate(string txt)
    {
    if (!Char.IsDigit(e.KeyChar) && e.KeyChar != (char)8)
    {
    e.Handled = true; // input is not passed on to the control(TextBox)
    }
    }
    }

    BUT in the validate.cs class .. how do i declare the e.. Error 3 The name 'e' does not exist in the current context

    C# design help question

  • listview.
    A angels777

    may i know how do i get the ID from the datagridview ?

    C# visual-studio question

  • listview.
    A angels777

    hi.. sorry.. i think i would like to use up the DataGridView called dvCustomer under private void dvCustomer_SelectionChanged(object sender, EventArgs e) { } when i click on the datagridview row... i would like to get the user ID from database. so that i can do the update as below ..

    private void cust_update_Click(object sender, EventArgs e)
    {
    bool success;
    success = dataAccess.AddCustomer(Datagridview ID, cust_name.Text, cust_add.Text, cust_account.Text, cust_phone.Text...);
    if (success)
    {
    MessageBox.Show("Data updated!");
    }
    else
    {
    MessageBox.Show("Update FAIL!!!");
    }
    }

    in my dataAccess class

    public bool AddCustomer(string function, string custName, string custAdd, string custAcc, string custPhone.....)
    {
    bool success = false;
    string query = string.Empty;
    try
    {
    SqlCommand cmd = new SqlCommand();
    cmd.Parameters.Add(new SqlParameter("@companyName", custName));
    cmd.Parameters.Add(new SqlParameter("@customerAdd", custAdd));
    cmd.Parameters.Add(new SqlParameter("@attName", custAdd));
    cmd.Parameters.Add(new SqlParameter("@customerAcc", custAcc));
    cmd.Parameters.Add(new SqlParameter("@customerPhone", custPhone));

    query += "UPDATE CUSTOMER set company_name= @companyName, company_add= @customerAdd, att_name= @attName, account_num= @customerAcc, phone= @customerPhone...........";
    query += " where cust_id = ?????????? ";

                cmd.CommandText = query;
    
                if (cn.State == ConnectionState.Closed) cn.Open();
                cmd.Connection = cn;
    
                if (cmd.ExecuteNonQuery() > 0)
                {
                    success = true;
                    return success;
                }
    
    C# visual-studio question

  • listview.
    A angels777

    hi.. why when i drag out a listview in vs 2005. i cant get teh function of listview.selectedindex ? only selecteditem .. i want to get the id of the data selected ..

    C# visual-studio question

  • listview problem
    A angels777

    hi.. i have a question related to the listview.. i did the below things.. but how do i assign the value to the listview /?

    void call_listview()
    {
    cmd.Connection = con;
    cmd.CommandText = "select * from contact";
    da.SelectCommand = cmd;

            DataTable store = new DataTable();  
            try
            {
               
                ds.Clear();
                con.Open();
                da.Fill(ds);
                store = ds.Tables\[0\];
    
                int count\_friend = store.Rows.Count;
                contact\_total\_friends.Content = count\_friend;
               
                contact\_listview.DataContext = ds.Tables\[0\].DefaultView;
            }
    
            catch (Exception ex)
            {                
                MessageBox.Show(ex.Message);            
            }
            finally
            {
                con.Close();
            }
        }
    
    C# question help

  • Software integration has always been a big problem
    A angels777

    can .NET run in UNIX ?

    .NET (Core and Framework) csharp sysadmin help question announcement

  • Software integration has always been a big problem
    A angels777

    In a large organization, if you have UNIX applications, mainframe applications, Windows applications, etc. How do you get these to talk to each other? may i know how .NET solve this problem ? also, during deployment,we have to worry about which version of IE is installed, which version of MDAC is installed, etc. we may have to test our install on Windows 95, 98, ME, NT, 2000, and XP, with different service packs, to insure that the install and uninstall work correctly. may i know how .NET solve this ?

    .NET (Core and Framework) csharp sysadmin help question announcement

  • overriding
    A angels777

    class A { public virtual void F() {} } class B: A { new private void F() {} // Hides A.F within B } class C: B { public override void F() {} // Ok, overrides A.F } may i knwo whta is Hides A.F within B and overrides A.F ?? thanks

    C# question

  • what is this mean
    A angels777

    Hi may i know what is the 0000000 mean? CREATE PROCEDURE [users_retrieve] @UserId bigint = 00000000,

    C# question

  • get curson position in richtextobx
    A angels777

    hi i tried insert the emoticon in the richtectbox where it follows my cursor position.. but it always go to behind text Image imgCtrl = new Image(); BitmapImage bmp = new BitmapImage(); bmp.BeginInit(); bmp.StreamSource = Application.GetResourceStream(new Uri("pic.jpg", UriKind.RelativeOrAbsolute)).Stream; bmp.EndInit(); imgCtrl.Source = bmp; InlineUIContainer iu = new InlineUIContainer(imgCtrl); TextPointer pos = richBox.CaretPosition; pos.Paragraph.Inlines.Add(iu);

    WCF and WF

  • maintain back the combobox item
    A angels777

    how do i make the comboxitem isselected when i retrived back the data from database? i tried as below if reminder is 1 day , the comboxboxitem (reminder1) will be selected.. is this correct? if (row["reminder"].ToString().Trim() == "1") { reminder_1.IsSelected = true ; }

    C# question database
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups