Showing posts with label WebApplication. Show all posts
Showing posts with label WebApplication. Show all posts

Ho To Get Current Page URL,PATH,HOST NAME in Asp.Net C#

Current Page URL,PATH,HOST NAME


Current  Browser Page Url,Path,Hostname Get From TextBox Using Asp.Net C# 


                                                 DEMO

                                               


                                            
                             Download Coding

                                                   Download 

                                   HTML CODING


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>   
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="URL" />
        <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="PATH" />
        <asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="HOST" />
        <asp:Label ID="lblGET" runat="server" Font-Size="Larger" ForeColor="#CC3300" Text="Label" Width="100px"></asp:Label>       
   
    </div>
    </form>
</body>
</html>



                                   C# CODING

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Add : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {       
      
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
       lblGET.Text=HttpContext.Current.Request.Url.AbsoluteUri;
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        lblGET.Text = HttpContext.Current.Request.Url.AbsolutePath;
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        lblGET.Text = HttpContext.Current.Request.Url.Host;
    }
}


First - Add New Form - Add Buttons & Lable From ToolBox 





Next - Label - Call Url,Host ,Path From Current URL







Next - Run[F5] - Press Button Get The Url,Path,Hostname








Automatically Take Snap Shots Capturing Interval Using Bitmap in Window Application or Web Application C#

Automatically Take Snap Shots Capturing

Automatically Take A Screen Capture Particular Interval Time Save To Date Time as  Name Using Window Application.

                              
                                 DEMO



                                  Download Coding
                                        
                                                         Download

                                     C# CODING


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Imaging;

public partial class ScreeeCapturen : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string a = DateTime.Now.Day.ToString();
        string b = DateTime.Now.Month.ToString();
        string c = DateTime.Now.Year.ToString();

        string d = DateTime.Now.Hour.ToString();
        string f = DateTime.Now.Minute.ToString();
        string g = DateTime.Now.Second.ToString() + ".00";

 string e1 = "Date=" + a + "-" + b + "-" + c + "&&Time=" + d + "." + f + "." + g;

        Bitmap bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

        Graphics graphics = Graphics.FromImage(bitmap as System.Drawing.Image);

        graphics.CopyFromScreen(25, 25, 25, 25, bitmap.Size);

        bitmap.Save(@"D:\Capturing\"+e1+".png", ImageFormat.Bmp);

       // bitmap.Save(@"D:\Capturing\" + e1 + ".png", ImageFormat.Bmp);

       // bitmap.Save(@"D:\Capturing\" + e1 + ".jpg", ImageFormat.Bmp);

       // bitmap.Save(@"D:\Capturing\" + e1 + ".bmp", ImageFormat.Bmp);

    }

}



First - Add New Form - Add NameSpaces - Call Windows Activity




Next - Add Reference - Right Click - Project Name - Add Reference Click





Next - FrameWork - System.Windows.Forums   - OK






Image Save To DataTime Name  - Particular folder






Next - Add Timer - Set Interval - Add - Script Manager 






Next - Run[F5]  - Particular Interval Take Snap Shots











Capture Screen Shot Automatically Using Bitmap in Window Application Or Web Application C#

Capture Screen Shot Automatically

Capturing Screenshots System Automatically in Bitmap Images Save To Folder in Window Application Or Web Application.

                            DEMO




                        C# CODING


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Imaging;


public partial class ScreeeCapturen : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        Bitmap bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

        Graphics graphics = Graphics.FromImage(bitmap as System.Drawing.Image);

        graphics.CopyFromScreen(25, 25, 25, 25, bitmap.Size);

        bitmap.Save(@"D:\Capturing\CapturingImage.bmp", ImageFormat.Bmp);

    }

}



First - Add NEw Web Form - Add NameSpaces For 

Call Windows Activity





Next - Solution Explorer - Project Name - Right Click - Add Reference 





Next - Select Framwork  - System.Windows.Forms  - OK





Next - Add The Form Page Load Capturing Coding





Next - Run [F5]  - Page Load Get Screen Shot & Saved To Given Path.






Open & View  The Captured Picture





Difference Between Web Site and Web Application


Difference Between WebSite and Web Application 



        Web Application      Web Site      
1
After Deployment Individual Files Can  Not Update
 After Deployment Individual Files Can Update
2
Web Application  Establish Dependencies in Multiple Projects.
Web Site Can not Establish Dependencies in Multiple Projects.
3
Can not Use  C# and VB in Single Page .
Use Both C# and VB in Single Page.
4
I.Web Application is Much Difficult than Web Site.

II.Used To Group Of Works.

III.Multiple Developer Work Easily Manage,Accessing

I.WebSite Is Easier than Create Web Application.

II. Used To WebSite Development.

III.Easier to One Person Developing (Creating ,Managing).