Category Archives: .net

Informazioni, guide, esempi riguardanti .net

  • This is an error that caused me some headaches while dealing with asp .net pages, but only with Firefox browser. Problem is “caused” by Firefox itself, that cache form fields. There are two possible solutions to this matter, here they comes: 1) insert the following function in your .cs file [sourcecode lang="c"] protected override void more info

  • Here is another software developed for the Associazione Italiana di Telerilevamento: it’s a web based solution developed in .net and mysql that allow to insert, review and manage articles. Authors can register and upload their articles for further publication after successful revision by one or more … well … reviewers that check the article and more info

  • C++ check if internet connection is active

    No CommentsWritten on November 2, 2008 at 10:19 pm , by

    [sourcecode language="cpp"] #include “intshcut.h” … // check if internet connection is active. if( !InetIsOffline( 0 )) { // Connession available. } [/sourcecode]

  • C++ convert local time in UTC or GMT

    No CommentsWritten on November 2, 2008 at 10:15 pm , by

    [sourcecode language="cpp"] // get local time. SYSTEMTIME LocalTime = { 0 }; GetSystemTime( &LocalTime ); // time zone informations TIME_ZONE_INFORMATION TimeZoneInfo; GetTimeZoneInformation( &TimeZoneInfo ); // convert hour in UTC format SYSTEMTIME GmtTime = { 0 }; TzSpecificLocalTimeToSystemTime( &TimeZoneInfo, &LocalTime, &GmtTime ); // convert hour in GMT format float TimeZoneDifference = -( float(TimeZoneInfo.Bias) / 60 ); more info

  • C++ grab window screenshot

    No CommentsWritten on November 2, 2008 at 10:12 pm , by

    [sourcecode language="cpp"] void CScreenShotDlg::OnPaint() { // device context for painting CPaintDC dc(this); // Get the window handle of calculator application. HWND hWnd = ::FindWindow( 0, _T( “Calculator” )); // Take screenshot. PrintWindow( hWnd, dc.GetSafeHdc(), 0 ); } [/sourcecode]

  • C# how to delete Internet Explorer cache

    No CommentsWritten on November 2, 2008 at 10:09 pm , by

    [sourcecode language="csharp"] using System.IO; private void EmptyCacheFolder(DirectoryInfo folder) { foreach (FileInfo file in folder.GetFiles()) { file.Delete(); } foreach (DirectoryInfo subfolder in folder.GetDirectories()) { EmptyCacheFolder(subfolder); } } public bool ClearCache() { bool isEmpty; try { EmptyCacheFolder(new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache))); isEmpty = true; } catch { isEmpty = false; } return isEmpty; } if(!(ClearCache())) { // job done ! more info

  • C# send email message

    No CommentsWritten on November 2, 2008 at 10:07 pm , by

    [sourcecode language="csharp"] public static string SendMail(string from, string to, string subject, string body, string smtp) { // create the message object MailMessage message = new MailMessage(from, to, subject, body); //message.Bcc.Add(“qualcuno@inbcc.est”); // some Bcc if needed message.IsBodyHtml = true; // create a new SmtpClient object SmtpClient mailClient = new SmtpClient(smtp, 25); try { // Send the more info

  • C# run a Google search from you default browser

    No CommentsWritten on November 2, 2008 at 10:04 pm , by

    [sourcecode language="csharp"] public static class Google { public static void SearchGoogle(string searchQuery) { string fixedSearchQuery = null; foreach (char character in searchQuery) { if (Char.IsLetterOrDigit(character)) { fixedSearchQuery += character; } else if (character == Char.Parse(” “)) { fixedSearchQuery += “+”; } else { fixedSearchQuery += Uri.HexEscape(character); } } string url = @”http://www.google.com/search?hl=en&q=” + fixedSearchQuery; try more info