Thursday, 16 June 2016

C3

http://www.c-sharpcorner.com/code/2827/c-sharp-program-to-shutdown-or-turn-off-computer.aspx

http://www.c-sharpcorner.com/code/2700/read-excel-file-without-microsoft-jet-oledb-4-0-reference-file-saveas-or-excel.aspx

http://www.c-sharpcorner.com/code/2711/simple-bus-traffic-simulation-with-information-service.aspx

http://www.c-sharpcorner.com/article/train-wreck-pattern-cascade-method-pattern-in-C-Sharp/

http://www.c-sharpcorner.com/article/silent-installation-of-applications-using-C-Sharp/

http://www.c-sharpcorner.com/article/sending-sms-using-C-Sharp-application/

http://www.c-sharpcorner.com/code/2085/send-image-audio-video-and-message-from-c-sharp-to-whatsapp.aspx

http://www.c-sharpcorner.com/code/2048/desktop-activity-recording.aspx

http://www.c-sharpcorner.com/UploadFile/87b416/why-we-should-prefer-to-use-dispose-method-then-finalize-met/

http://www.c-sharpcorner.com/blogs/communicate-with-whatsapp-from-website-in-c-sharp1


Wednesday, 15 June 2016

windows appln

http://www.c-sharpcorner.com/uploadfile/b4f4a4/birthday-reminder-in-C-Sharp/

http://www.c-sharpcorner.com/uploadfile/krishnasarala/transfer-files-over-bluetooth-devices/

http://www.c-sharpcorner.com/UploadFile/1b29b1/hotel-menu-application-in-windows-C-Sharp/

http://www.c-sharpcorner.com/uploadfile/leokoach/virtual-photo-album-in-C-Sharp/

http://www.c-sharpcorner.com/UploadFile/thiagu304/remote-desktop-using-C-Sharp-net/

http://www.c-sharpcorner.com/uploadfile/scottlysle/parsing-sentences-and-building-text-statics-in-C-Sharp/

http://www.c-sharpcorner.com/article/mapping-with-a-gps-and-C-Sharp/

http://www.c-sharpcorner.com/article/build-a-simple-watermarking-utility-in-C-Sharp/

http://www.c-sharpcorner.com/article/simple-application-to-zip-and-unzip-files-in-C-Sharp-using-jsharp-lib/

http://www.c-sharpcorner.com/article/monitor-internet-connection-state/

http://www.c-sharpcorner.com/article/led-control-emulation/

http://www.c-sharpcorner.com/article/a-simple-approach-to-product-activation/

http://www.c-sharpcorner.com/article/file-splitter-in-net/

http://www.c-sharpcorner.com/article/analog-clock-widget-in-C-Sharp/

http://www.c-sharpcorner.com/article/mortgage-calculator-in-C-Sharp-and-net/

http://www.c-sharpcorner.com/article/advertising-board/

http://www.c-sharpcorner.com/article/playing-avi-files-using-directx-9-with-C-Sharp-and-net/

http://www.c-sharpcorner.com/article/im-chat-interface-for-C-Sharp-and-net/

http://www.c-sharpcorner.com/article/key-logger-application-in-C-Sharp/

http://www.c-sharpcorner.com/article/a-quiz-application-using-windows-form/

http://www.c-sharpcorner.com/article/interactive-shaped-forms/

http://www.c-sharpcorner.com/blogs/find-latitude-and-longitude-of-a-system

http://www.c-sharpcorner.com/UploadFile/df5827/create-whatsapp-messenger-in-windows-form-application/

http://www.c-sharpcorner.com/blogs/get-all-installed-languages-on-computer-and-set-selected-language-as-input-language-in-winform

http://www.c-sharpcorner.com/UploadFile/302f8f/creating-own-web-browser-in-C-Sharp/

http://www.c-sharpcorner.com/UploadFile/asmabegam/audiovideo-and-youtube-video-player-C-Sharp-winform/

http://www.c-sharpcorner.com/UploadFile/pandeypradip/testing-of-push-notification-using-windows-form-application/

http://www.c-sharpcorner.com/UploadFile/996353/create-setup-and-deployment-project-in-visual-studio-200820/

http://www.c-sharpcorner.com/UploadFile/996353/create-setup-and-deployment-project-in-visual-studio-200820/

http://www.c-sharpcorner.com/blogs/sql-injection-in-windows-forms-application1

http://www.c-sharpcorner.com/UploadFile/deepak.sharma00/how-to-play-flash-in-windows-forms-application-using-C-Sharp/

http://www.c-sharpcorner.com/blogs/collections-in-c-sharp


Wednesday, 1 June 2016

asd

http://stackoverflow.com/questions/26354472/how-can-i-get-users-location-without-asking-for-the-permission-or-if-user-permi

Wednesday, 16 March 2016

rename file with date time

ren fud fud_%date:~4,2%-%date:~7,2%-%date:~10,4%_%time:~0,2%%time:~3,2%_%time:~6,5%.jpg 

Tuesday, 15 March 2016

Check file exists using c#

if (File.Exists(filePath)) {   
    byte[] data = File.ReadAllBytes(filePath);
    string fileName = Path.GetFileName(filePath);

    const string query = "INSERT INTO Files (FileName, Data, Path) VALUES (@FileName, @Data, @Path)";

    using (var connection = new SqlConnection(connectionString))
    using (var command = new SqlCommand(query, connection)) {
        command.Parameters.AddWithValue("@FileName", fileName);
        command.Parameters.AddWithValue("@Data", data);
        command.Parameters.AddWithValue("@Path", filePath);

        connection.Open();
        command.ExecuteNonQuery();
    }
}

http://www.codeproject.com/Tips/849516/How-to-Search-for-an-Excel-File-in-a-Folder-using
http://www.codeproject.com/Articles/368530/Dynamic-Excel-file-loading-with-SSIS
https://www.youtube.com/watch?v=_B83CPqX-N4
https://www.youtube.com/watch?v=Ui4vera72Ng

Monday, 14 March 2016

Task.Delay Example in c#

private void button4_Click(object sender, EventArgs e)
        {


            if (textBox6.Text != "" && textBox7.Text != "" && textBox8.Text != "" && textBox9.Text != "" )
            {
                // 11:00:00
                var DailyTime = "" + textBox8.Text + ":" + textBox7.Text + ":" + textBox6.Text + "";
                var timeParts = DailyTime.Split(new char[1] { ':' });

                var dateNow = DateTime.Now; // current time
                var date = new DateTime(dateNow.Year, dateNow.Month, dateNow.Day,
                           int.Parse(timeParts[0]), int.Parse(timeParts[1]), int.Parse(timeParts[2])); // user input time
                TimeSpan ts;
                if (date > dateNow)
                    ts = date - dateNow;
                else
                {
                    // date = date.AddDays(1);
                    date = date.AddHours(12);
                    ts = date - dateNow;
                    if (date == dateNow)
                        //  ts = date - dateNow;
                        ts = dateNow - date;
                }
                string msg = textBox9.Text;

                //waits certan time and run the code
                Task.Delay(ts).ContinueWith((x) => SomeMethod(msg));

                Console.Read();
                MessageBox.Show("Reminder added succesfully !!");
                textBox6.Text = "";
                textBox7.Text = "";
                textBox8.Text = "";
                textBox9.Text = "";
            }
            else
            {
                MessageBox.Show("All Fields Are Mandatory !!");
            }
        }

static void SomeMethod(string reminderMsg)
        {
          //  MessageBox.Show("" + reminderMsg + "" + "@:" + DateTime.Now.ToString());
          //  MessageBox.Show(new Form() { TopMost = true }, "" + reminderMsg + "" + "@:" + DateTime.Now.ToString());
            TopMostMessageBox.Show("" + reminderMsg + "" + "  Reminder set at :"+ DateTime.Now.TimeOfDay.ToString()+"", "Reminder !!!", MessageBoxButtons.OK);
         
        }

Monday, 7 March 2016

BCP CSV FILE TO SQL SERVER TABLE

NOTEPAD FORMAT : SAVE AS .fmt

11.0
3
1   SQLCHAR     0     10    "," 1   ID       SQL_Latin1_General_CP1_CI_AS
2   SQLCHAR     0     20    "," 2  NAME SQL_Latin1_General_CP1_CI_AS
3   SQLCHAR     0     30    "\r\n" 3  ADDR SQL_Latin1_General_CP1_CI_AS


PROC :

CREATE TABLE TEMPSVK(ID INT,NAME VARCHAR(20),ADDR VARCHAR(20))

exec master..xp_cmdshell 'bcp "test.dbo.TEMPSVK" in "D:\excel\Check.csv" -T -F1 -f "D:\excel\test.fmt" '

select @@SERVERNAME

select * from TEMPSVK

truncate table TEMPSVK


exec master..xp_cmdshell 'bcp "test.dbo.TEMPSVK" in "D:\excel\Check_1.xls" -T -F1 -f "D:\excel\test.fmt" '


SAMPLE EXCEL IN CSV FILE FORMAT :

ID NAME ADDR
100 AAA CHENNAI
101 BBB CHENNAI
102 CCC CHENNAI