Posts

Showing posts from 2012

Advertisement.

TransHimalaya.in

Everest Helicopter Tour for a day

Book exciting packages at www.transhimalaya.in

Program runs fine but not running from task scheduler

Image
Problem domain: When I run the progam from the command line it works correctly. When I run the program from the
Windows  Task Scheduler it does not start or start with error.
  I have a console app that I wrote, which runs just fine when I click on ConsoleApp1.application file.  I want the task scheduler to run this console app every ten minutes, so I set up a task using task scheduler.  Whenever the task scheduler tries to run it, though, it fails, and return an erro rmessage
 I have avb.net app that I wrote, which runs just fine when I click on *.exe file.  I want the task scheduler to run this app every ten minutes, so I set up a task using task scheduler.  Whenever the task scheduler tries to run it, though, it fails, and return an error rmessage.
Solution:
Use task scheduler application startup path (optional) Option and have Everyone with full permission to all files reated to app.
After alot scratching my head and giving full permission with Everyone i finally succeded to run my vb.n…

Windows 8 : Enable Remote Desktop Connection

Windows 8 : Enable Remote Desktop Connection

Step1 : First open control panel

Go to TopRight Corner > Settings
Control Panel > Ease of Access > Folder Option

Step2: click on System and Security.

Step3:  click on Allow remote access under System in right Pane.

Step4: Go to  Remote tab click Allow  remote connections to this computer and click on Apply

If yourself want to use Remote Desktop then go to metro search and type Remote. If not download it from Miscrosoft App.
For Metro Search Go to TopRight Corner > Search

- Vinod Kotiya
www.vinodkotiya.com

Windows 8 : Get back classic start menu without software

Windows 8 : Get back classic start menu without software

Step1 : First enable hidden files and folder from
Go to TopRight Corner > Settings
Control Panel > Ease of Access > Folder Option

Step2: Create a new shortcut for start menu by
- Go to Windows 8 Desktop
- Right Click on Taskbar and Select "Toolbars", then Select "New Toolbar"
- On the Folder Selection Dialog box opened , Navigate to "C:\ProgramData\Microsoft\Windows\Start Menu\Programs"
(* You wont be able to navigate if step1 not done)
- Click "Select Folder"

This will create a simple start menu for your windows 8 without installing any third party software. So it would be quick and fast.

-
Vinod Kotiya
www.vinodkotiya.com

Pakistan's India Tour for ODI & T20 series in December 2012 and January 2013

Pakistan's India Tour for ODI & T20 series in December 2012 and January 2013


Schedule : Pakistan tour of India, Dec 2012 & Jan 2013.DateMatchVenue25 Dec 2012India v Pakistan, 1st T20 (N)Bangalore27 Dec 2012India v Pakistan, 2nd T20 (N)Ahmedabad30 Dec 2012India v Pakistan, 1st ODI (Day)Chennai3 Jan 2013India v Pakistan, 2nd ODI (Day)Kolkata6 Jan 2012India v Pakistan, 3rd ODI (Day)Delhi
The online tickets of India vs Pakistan 2012-13, is likely to be available at Viagogo.com. . The tickets  will be delivered to you by international courier. You should purchase the  match tickets at least a month before Pakistan vs India match begins.

sqldatasource listview not updating,inserting mysql data

listview not updating,inserting mysql data.

Data entered in textboxes is not getting updated in database. In debug mode I see that textbox1 and textbox2 in ItemUpdating event contain the same values as they had before calling ItemUpdating. therefore you are able to populate data in listview using select command but not able to update or insert.

Solution one : have a datakey value for listview property like  DataKeyNames="id"  where id is primary key


solution2 : check the connection string property it shoud be like this



add name="entertrackConnectionString" connectionString="server=191.254.1.xx;User Id=admin;password=xxxx;database=entertrack;Persist Security Info=True; SQLServerMode = true;Allow Zero Datetime=True;"
   providerName="MySql.Data.MySqlClient"

asp.net Upload excel file in DataTable

Image
asp.net Upload excel file in DataTable and show in gridview control

aspx code

      <asp:Label ID="lblMsg" runat="server" Text="Upload excel file"></asp:Label>
</div>
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
<div id="fileatt" runat="server" style="display: block" >
            <input type="file" name="attachment" runat="server" id="attachment"  />
            </div>


      <asp:Button ID="btnUpload1" runat="server" Text="Upload" OnClick="btnUpload1_Click" Visible="true" />


VB Code Imports System.Data Imports System.Data.OleDb ..... .....  Protected Sub btnUpload1_Click(sender As Object, e As System.EventArgs) Handles btnUpload1.Click         Try             Dim uploadDir = "./upload/"             Dim temp = ""             Dim connectionString…

prevent user from logging back in after logging out by hitting back button

prevent user from logging back in after logging out by hitting back button Disabling browser back button by javascript is a bad idea. Here is an example that logs the user in and logs the user out and also checks if the user is logged in. When you click the logout page you're automatically logged out and redirected. Clicking back won't change anything you still won't be logged in.
in login.php file
session_start(); // If they are  logged in, send them to homee if(isset($_SESSION['isLoggedIn'])) {  //   header("Location: start.php");
              echo '<script language="javascript">';
        echo 'top.location.href = "start.php";';
        echo '</script>';


}
also add this after succesful login in login.php file
if(authenticate_user($myusername,$mypassword)) { //$_SESSION['login_user']=$myusername; $_SESSION['isLoggedIn'] = true; --- }
for all webpages of ur site write this in common.php
sessio…

Simple Login Encryption in javascript and decryption in PHP

Simple Login Encryption in javascript and decryption in PHP
Solution wont show your username in plain text during transit but still It's possible to do man-in-the-middle attacks. for password encryption check http://vinodkotiya.blogspot.in/2012/08/change-or-encrypt-post-data-before.html
can be implemented through XoR.

simple Javascript Encryption code


function encryptUser(str) {

    var encoded = "";
    for (i=0; i
        var a = str.charCodeAt(i);
        var b = a ^ 6;    // bitwise XOR with any number, e.g. 123
        encoded = encoded+String.fromCharCode(b);
    }
    return encoded;
}

simple php Decryption function
function decryptUser($text) {  // Our output text  $outText = '';
 // Iterate through each character  for($i=0;$i  {
         $outText .= chr(ord($text{$i}) ^ 6); // bitwise XOR with any number, e.g. 123
 }  return $outText;
}
- Vinod Kotiya

Autocomplete Text Box with dropdown from MySQL database webservice vb asp.net

Autocomplete Text Box with dropdown from database webservice vb asp.net

Ajax autocomplete extender with a textbox  using a MySQL database

1. Write webservice.vb in App_code


              Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols Imports MySql.Data Imports MySql.Data.MySqlClient Imports System.Data Imports System.Data.SqlClient
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://vinodkotiya.com/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class WebService
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function HelloWorld() As String
        Return "Hello World"
    End Function
    <WebMethod()> _
    Public Function GetCompletionList(prefixText As St…

How To Fix Android Market Package File Is Invalid, No Download At All, Download Unsuccessful Error ( Play Store )

How To Fix Android Market Package File Is Invalid, No Download At All, Download Unsuccessful Error ( Play Store )

Sometimes when we try to download new apps on Android market we receive "Package File is invalid", "No download at all" or "Download unsuccessful" errors. Sometimes you may receive all of them. After you received this error we can't install and update any apps on the Android market. There are 5 ways to fix this issue. The issue came on my custom ROM Hyvrid v3 for micromax A70 which resolved by method 1. even wiping the cache, wiping the dalvik cache was not resolving problem

1. Clear data and cache of play store


First visit "Menu > Settings > Applications > Manage applications". Now Tap "All" and search Market app, and tap it. Now tap "Clear cache" and "Clear data" and finally click "Uninstall updates". Like following screen shot. If still ur issue not resolved do further (mine was re…

change or encrypt post data before submit

A user enters their password, and submits the login form. The password is sent to the server, authentication is run, and the hashed password matches the one stored in the database.
The onsubmit event occurs when the submit button in a form is clicked.

    <script src="http://crypto-js.googlecode.com/svn/tags/3.0.2/build/rollups/md5.js"></script>

<script type="text/javascript">
function encryptPWD()
{
//Here do whatever you want to do with the form or it's values.
//can change any elements value.and hidden field

//alert("Welcome " + document.forms["logForm"]["username"].value + "!");
//Getting the two input objects

var pwd=document.forms["logForm"]["password"].value;
//Hashing the values before submitting

document.forms["logForm"]["password"].value =  CryptoJS.MD5(pwd);
}
</script>




<form action="" method="post"  name="logForm" onsubmit=…

ADB to restore recovey.img of Android Micromax A70

‘flash_image’ http://www.addictivetips.com/?attachment_id=42198 is a tool for Android devices that lets you rewrite your phone’s system partitions with partition image files and installing it to your device requires ADB.

Download flash_image and extract it from the zip file to a location on your computer. We extracted it to the main C drive (not in any folder) and will use that in the next steps.
Download the recovery from net (A70) & copy it to C:\
Enable USB debugging mode on your device from Menu > Settings > Applications > Development.
Connect your device to your computer via USB.
Open a Command Prompt window on your computer and enter the following commands:
adb push c:\flash_image /sdcard/
adb push c:\recovery.img /sdcard/
adb shell
su
mount -o remount, rw /system
cp /sdcard/flash_image /system/bin
cd /system/bin
chmod 777 flash_image
flash_image recovery /sdcard/recovery.img
This will first transfer flash_image and recovery.img to your phone. Then it will copy flash_image …

Convert excel to HTML and ftp upload second method

Start “Microsoft Visual Basic 2008 Express." Select the “File” menu, then click “New Project…” Click “Windows Forms Application” under “Visual Studio installed templates.” Select “OK."


Click “Project,” then select “Add Reference." Click “COM," select “Microsoft Excel 12.0 Object Library” and click “OK."


Imports Microsoft.Office.Interop


Public Class Form1
    Public status As String
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Dim excelApplication As New Excel.Application
        Dim excelWrkBook As Excel.Workbook
        excelApplication.Visible = False
        excelApplication.DisplayAlerts = False
        Dim theFile As String = "abc.xlsx"
        status = status & " Loading xlsx "
        excelWrkBook = excelApplication.Workbooks.Open("E:\webapp\ppm\upload\PPM\DAILYFLASH\" & theFile)
        Dim tempSourceFile As String = "E:\winapps\excel2htmlconverter\excel2htmlco…

Convert Excel to HTML and ftp upload

Start Visual Studio.On the File menu, point to New, and then click Project.In the templates pane, expand Visual C# or Visual Basic, and then expand Office.Under the expanded Office node, select the 2007 if you have Excel 2007 installed, or select the 2010 node if you have Excel 2010 installed.In the list of project templates, select Excel 2007 Add-in or Excel 2010 Add-in.In the Name box, type Excel2HtmlConverter. Click OK.
Imports System.IO Imports System.Data Imports System.Net Imports System.Threading Imports System.Net.Sockets Imports MySql.Data.MySqlClient
PublicClassThisAddIn Public status AsString
PrivateSub ThisAddIn_Startup() HandlesMe.Startup Dim theFile AsString = getFilename()         Application.Workbooks.Open("E:\webapp\ppm\upload\PPM\DAILYFLASH\" & theFile)         status = status & " Loading xlsx " Dim touploadFile AsString = "E:\winapps\dailyFlashExcel2Html\dailyFlashExcel2Html\bin\Debug\htm\" & "dfcr" & Left(theFile, 8) &…

Google+ Followers