2009-08-27

Creating a dummy file of specific size using Command Prompt

Creating a dummy file of specific size using Command Prompt

To do this, we can use a tool in Windows (XP and above) call fsutil.exe command-line tool

Command syntax:

fsutil file createnew DummyFileName DummyFileSize

DummyFileName = the desire file name
DummyFileSize = the desire file size (in bytes)

Detail Info :
==========================================
C:\>fsutil file /?
/? is an invalid parameter.
---- FILE Commands Supported ----

findbysid Find a file by security identifier
queryallocranges Query the allocated ranges for a file
setshortname Set the short name for a file
setvaliddata Set the valid data length for a file
setzerodata Set the zero data for a file
createnew Creates a new file of a specified size

2009-08-12

Using batch file to redial a DialUp connection

Create a batch file with the following content

@echo off
@echo "Disconnecting Connection"
rasphone -h "Vodaphone Broadband"

@echo "Waiting for 3 seconds"
timeout /t 3 /NOBREAK

@echo "Connecting to Connection"
rasphone -d "Vodaphone Broadband"

Just replace Vodaphone Broadband with your dial up connection name, and that should do it.
In case the timeout doesn't work, just replace it with "ping -n 10 127.0.0.1 > NUL", this will use
"ping" to create delay.

2009-08-11

VS2008 Could not load file or Assembly CustomMarshalers.dll

Error Could not load file or Assembly CustomMarshalers.dll

An error after installing VS2008 and create ANY new project.

"Could not load file or assembly CustomMarshalers, Version=2.0.0.0 etc"

This is because some file was not installed into the GAC

Use VS2008 command prompt and type
c:\>gacutil -i C:\Windows\Microsoft.NET\Framework\v2.0.50727\CustomMarshalers.dll

to solved the issue.

source : http://itcodemonkey.blogspot.com/2009/07/could-not-load-file-or-assembly.html

2009-08-04

Programmatic control DataPager Template

How to programmatically control DataPager Template

Protected Sub ListView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs)
Dim DataPager1 As DataPager = DirectCast(ListView1.FindControl("DataPager1"), DataPager)
If (DataPager1.StartRowIndex = 0) Then
Dim PrevThousand As LinkButton = DirectCast(DataPager1.Controls(2).FindControl("PrevThousand"), LinkButton)
PrevThousand.Enabled = False

Dim PrevHundred As LinkButton = DirectCast(DataPager1.Controls(2).FindControl("PrevHundred"), LinkButton)
PrevHundred.Enabled = False

Dim PrevTen As LinkButton = DirectCast(DataPager1.Controls(2).FindControl("PrevTen"), LinkButton)
PrevTen.Enabled = False
End If
End Sub

source: http://forums.asp.net/t/1404164.aspx

ShareThis