વેબને કેપ્ચર અને કન્વર્ટ કરવા માટેનાં સાધનો

ASP.NET સાથે સ્ક્રીનશોટ ઇવેન્ટ્સ

ASP.NET API

GrabzIt નું ASP.NET API ઇવેન્ટ્સને પણ સપોર્ટ કરે છે, નીચેનાને હેન્ડલર સોંપવાનું એક ઉદાહરણ છે ScreenShotComplete સ્ક્રીનશshotટ કહેવાતા પહેલા ઇવેન્ટ. પછી એકવાર સ્ક્રીનશોટ અંદર કોડ પૂર્ણ થાય છે grabzIt_ScreenShotComplete પદ્ધતિ કહેવામાં આવે છે.

private GrabzItClient grabzIt = GrabzItClient.Create("Sign in to view your Application Key", "Sign in to view your Application Secret")%>");

protected void btnSubmit_Click(object sender, EventArgs e)
{ 
    grabzIt.ScreenShotComplete += grabzIt_ScreenShotComplete;
    grabzIt.URLToImage("https://www.tesla.com"); 	

    //The below line specifies the GrabzIt.ashx handler inside the GrabzIt.dll
    grabzIt.Save(HttpContext.Current.Request.Url.Scheme + "://" + 
    HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath
    + "GrabzIt.ashx");
}

//The event method saves the screenshot
protected void grabzIt_ScreenShotComplete(object sender, ScreenShotEventArgs result)
{
    GrabzItFile file = grabzIt.GetResult(result.ID);
    file.Save(Server.MapPath("~/results/"+result.Filename));
}

અંતે વેબકોન્ફિગને ગોઠવો જેથી GrabzIt.ashx pointઓ માટે હેન્ડલર માં જડિત GrabzIt DLL. જો આ યોગ્ય રીતે કરવામાં ન આવે તો ScreenShotComplete ઘટના બરતરફ કરવામાં આવશે નહીં.

આ યાદ રાખો કૉલબૅક જો તમારી એપ્લિકેશન લોકલહોસ્ટ પર સ્થિત છે, તો તે કાર્ય કરશે નહીં.

<httpHandlers>
        <add verb="*" path="GrabzIt.ashx" type="GrabzIt.Handler, GrabzIt" />
</httpHandlers>