Skip to content

C# Textbox Send To FTP or Mail (Stuck)

Brian McCuaig

Asked Feb 17, 2009, 10:38 AM EST1 answer
Share
LinkedInX
Hello Everyone... Could someone please help me with a code?
I have this problem.. I am making a LOGIN generator and I need to make it so both two texboxes send the info to my Email Or FTP server (Email is better please)
------------------------
Ex:
Username: name
Password: *****

Then when the person clicks ok it will send to my email or  FTP server (Email more needed).
If you could help it would be greatly appreciated and I could put u in the Staff tab on the program
P.S It is being made with Windows C#. The Type is --> (Windows Form application)

Thanks,
              bdude105

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Bechir Bejaoui
    0
    If I well understand the issue you have to negociate with a distant server regardless of it's nature but you have to use a userID and password to have sufficent credentials to access this server. If yes you can create a proxy within your client interface. you can make use of a WebProxy or you can either create you own proxy model by imlementing the IWebProxy interface.

    public class MyProxy : System.Net.IWebProxy
    {
        public string User { get; set; }
        public string Password { get; set; }
        private System.Net.ICredentials _NetWorkCredential;
        public MyProxy(string User, string Password)
        {
            this.User = User;
            this.Password = Password;
            _NetWorkCredential = new System.Net.NetworkCredential(User, Password);
        }
        public System.Net.ICredentials Credentials
        {
            get { return _NetWorkCredential; }
            set { _NetWorkCredential = value; }
        }

        public Uri GetProxy(Uri destination)
        {
            return new Uri(destination.AbsoluteUri);
        }

        public bool IsBypassed(Uri host)
        {
            return false;
        }
    }
    0