Xtreme Visual Basic Talk

Xtreme Visual Basic Talk (http://www.xtremevbtalk.com/)
-   ASP.Net (http://www.xtremevbtalk.com/asp-net/)
-   -   Asp.net: using Console application call Web-form application's method (http://www.xtremevbtalk.com/asp-net/328835-asp-net-using-console-application-call-web-form-applications-method.html)

kuba15 11-05-2017 02:50 PM

Asp.net: using Console application call Web-form application's method
 
I am trying to make web form asp.net application to windows service. I got a tutorial there console application used to convert exe file, then it is used as a windows service. That is run in starting of windows and do continue. I need web form (aspx, cs files used) page convert to service what will run in starting of windows. or any way to make cron-job of web form page where used timer,

Code:

aspx::
    <asp:Timer ID="Timer1" runat="server" Interval="" ontick="Timer1_Tick">
            </asp:Timer>
cs::
  public void CallMethod()//-------------------3
        {
            conCondition.GetConnectedConn();//con test from diff class
            CopyLocalDir();
            InsertAtmLogToDB();
            ParsedDataInsert();//
        }

        protected void Timer1_Tick(object sender, EventArgs e)//Ontick method-------defined in input----2
        {
            CallMethod();
        }

        public void getInterval()/// Called in page load-----to call::: Timer1_Tick-----------1
        {
            string selectTime = "select time from timer";
            con.Open();
            SqlCommand select = new SqlCommand(selectTime, con);
            SqlDataReader sdr = select.ExecuteReader();

            int setTime = 0;
            if (sdr.Read())
            {
                setTime = int.Parse(sdr["time"].ToString());
            }
            con.Close();
            Timer1.Interval = setTime;//set time to id(named Timer1) of input field(of aspx file)
        }



All times are GMT -6. The time now is 01:21 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO v2.0.15 (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
All site content is protected by the Digital Millenium Act of 1998. Copyright©2001-2011 MAS Media Inc. and Extreme Visual Basic Forum. All rights reserved.
You may not copy or reproduce any portion of this site without written consent.