System.Drawing.Image img = System.Drawing.Image.FromFile(@”c:ggsggs Accessimagesmembers1.jpg”); int width = img.Width; int height = img.Height; — Excel and Exporting When you export to Excel using OpenXML standard You usually mention where to start and where to end. I.e. cell to insert from and the width/height in number of cells. Hence, you need to know how many pixels …
Category: C# – Misc
Mar 24
Excel and C# #Root #By Sayed Ahmed
Adding image at a particular cell in Excel Spreadsheet https://social.msdn.microsoft.com/Forums/lync/en-US/5c6e7ebd-66e2-40fa-9194-aed5cdc3f0ae/adding-image-at-a-particular-cell-in-excel-spreadsheet?forum=oxmlsdk How to: Insert text into a cell in a spreadsheet document (Open XML SDK) https://msdn.microsoft.com/en-us/library/office/cc861607.aspx You will need reference to OpenXML, Systems.IO.Packaging, System.xml and/or similar. You may need to copy the related DLLs to your production at deployment (depends on your deploy …
Mar 23
File Downloading in C# Applications #Root #By Sayed Ahmed
For ASP.Net web form applications, you can use [for file download] Synchronously using System.Net; WebClient webClient = new WebClient(); webClient.DownloadFile(“http://mysite.com/myfile.txt”, @”c:myfile.txt”); or Asynchronously private void btnDownload_Click(object sender, EventArgs e) { WebClient webClient = new WebClient(); webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed); webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged); webClient.DownloadFileAsync(new Uri(“http://mysite.com/myfile.txt”), @”c:myfile.txt”); } private void ProgressChanged(object sender, DownloadProgressChangedEventArgs e) { progressBar.Value …
Mar 22
2nd part write c# tool to create html to pdf #Root #By Sayed Ahmed
2nd part write c# tool to create html to pdf [youtube http://www.youtube.com/watch?v=vyHsG_q4uW8?list=UUHrtq0pV8mEuTLGd2-Lp9ig&w=640&h=510] From: http://sitestree.com/?p=1686 Categories:Root, By Sayed AhmedTags: Post Data:2014-11-18 21:59:06 Shop Online: https://www.ShopForSoul.com/ (Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com In Bengali: http://Bangla.SaLearningSchool.com http://SitesTree.com 8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) Shop Online: https://www.ShopForSoul.com/ Medium: https://medium.com/@SayedAhmedCanada
Mar 22
Most Basic ASP.Net User Control (ASCX), ASCX and DNN #Root #By Sayed Ahmed
Most Basic ASP.Net User Control (ASCX), ASCX and DNN ASCX controls are one way to add functionality/features to Dot Net Nuke (DNN) Registration of User Control: <%@ Register TagPrefix=”uc” TagName=”dnn” Src=”dnn.ascx” %> <uc:dnn runat=”server”/> : how to use the control The most basic ASCX example can be seen at http://salearningschool.com/codes/ascx/most_basic_control/ From: http://salearningschool.com/codes/ascx/most_basic_control/dnn.ascx <%@ …
Mar 19
C# Localization Application Example #Root #By Sayed Ahmed
The Resource File # GreetingResources.txt # A resource file in text format for a “Hello World” application. # # Initial prompt to the user. prompt=Enter your name: # Format string to display the result. greeting=Hello, {0}! — Code to use the resource file using System; using System.Reflection; using System.Resources; public class Example { public static …
Mar 04
DotNetNuke ErrorPages.aspx #Web Development
<%@ Page Language=”C#” AutoEventWireup=”false” Inherits=”DotNetNuke.Services.Exceptions.ErrorPage” CodeFile=”ErrorPage.aspx.cs” %> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml” lang=”en-US”> <head> <meta name=”revisit-after” content=”1 days” /> <meta name=”robots” content=”noindex,nofollow” /> <title runat=”server” id=”Title”>Error</title> <link id=”DefaultStylesheet” runat=”server” rel=”stylesheet” type=”text/css” href=”~/Portals/_default/default.css” /> <link id=”InstallStylesheet” runat=”server” rel=”stylesheet” type=”text/css” href=”~/Install/install.css” /> </head> <body> <form id=”Form” runat=”server”> <table cellspacing=”5″ cellpadding=”5″ border=”0″> <tr> …
Mar 03
Some C# Stuff #Web Development #By Sayed Ahmed
Object-Oriented Programming (C# and Visual Basic) http://msdn.microsoft.com/en-CA/library/dd460654.aspx LINQ (Language-Integrated Query) http://msdn.microsoft.com/en-ca/library/bb397926.aspx 101 LINQ Sample Application http://code.msdn.microsoft.com/101-LINQ-Samples-3fb9811b Parallel LINQ (PLINQ) http://msdn.microsoft.com/en-us/library/dd460688%28v=vs.110%29.aspx Entity Framework http://msdn.microsoft.com/en-ca/data/ef.aspx Working with DBContext http://msdn.microsoft.com/en-ca/data/jj729737.aspx SOAP vs Rest https://stackoverflow.com/questions/209905/representational-state-transfer-rest-and-simple-object-access-protocol-soap http://msdn.microsoft.com/en-us/library/vstudio/hh323724%28v=vs.100%29.aspx Security in SOAP and REST http://msdn.microsoft.com/en-us/library/vstudio/hh323714%28v=vs.100%29.aspx WS-Security https://en.wikipedia.org/wiki/WS-Security SSO (Single Sign on) in …
Mar 03
A basic .Net MVC 4 and Razor Application: Demo, Code, Training video #Web Development #Root #By Sayed Ahmed
Demo of a Simple Movie Database http://demos.justetcetera.com/MvcRazorDemo/ CRUD operations are supported MVC 4 is used in ASP.Net platform and C# Razor Template Engine is used. The code is very similar to Laravel and Blade codes -> the skills transfer to some extent You can check and download the code from: You can find the …
Mar 02
DotNetNuke ErrorPages.aspx #Web Development #Root #By Sayed Ahmed
<%@ Page Language=”C#” AutoEventWireup=”false” Inherits=”DotNetNuke.Services.Exceptions.ErrorPage” CodeFile=”ErrorPage.aspx.cs” %> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml” lang=”en-US”> <head> <meta name=”revisit-after” content=”1 days” /> <meta name=”robots” content=”noindex,nofollow” /> <title runat=”server” id=”Title”>Error</title> <link id=”DefaultStylesheet” runat=”server” rel=”stylesheet” type=”text/css” href=”~/Portals/_default/default.css” /> <link id=”InstallStylesheet” runat=”server” rel=”stylesheet” type=”text/css” href=”~/Install/install.css” /> </head> <body> <form id=”Form” runat=”server”> <table cellspacing=”5″ cellpadding=”5″ border=”0″> <tr> …