Click here to Skip to main content
15,890,512 members
Home / Discussions / C#
   

C#

 
GeneralRe: Capturing the path of the image source from a PictureBox to a String Pin
Dave Kreskowiak3-Mar-04 18:39
mveDave Kreskowiak3-Mar-04 18:39 
GeneralRe: Capturing the path of the image source from a PictureBox to a String Pin
Sabyasachi Bose3-Mar-04 18:55
Sabyasachi Bose3-Mar-04 18:55 
Generalcreate web page snapshot Pin
AWebDude3-Mar-04 15:08
AWebDude3-Mar-04 15:08 
GeneralRe: create web page snapshot Pin
John Kuhn3-Mar-04 15:50
John Kuhn3-Mar-04 15:50 
Generalcreate web page content snapshot Pin
AWebDude4-Mar-04 3:17
AWebDude4-Mar-04 3:17 
GeneralRe: create web page content snapshot Pin
John Kuhn4-Mar-04 16:32
John Kuhn4-Mar-04 16:32 
QuestionIs there a way to programatically determine if a binary is managed code? Pin
Throckmorton3-Mar-04 13:51
Throckmorton3-Mar-04 13:51 
AnswerRe: Is there a way to programatically determine if a binary is managed code? Pin
Nathan Blomquist3-Mar-04 16:00
Nathan Blomquist3-Mar-04 16:00 
I know this function works with managed and unmanaged dlls. You could try it with executables though:

public bool IsManaged(string filePath)
{
	byte[] Data = new byte[4096];
	FileInfo file = new FileInfo(filePath);
	FileStream fin = file.OpenRead();
	int read = fin.Read(Data,0,Data.Length);
	fin.Close();
	// Verify this is a executable/dll
	if ((Data[1] << 8 | Data[0]) != 0x5a4d)
		return false;
	// This will get the address for the WinNT header
	Int32 iWinNTHdr = Data[63]<<24 | Data[62]<<16 | Data[61] << 8 | Data[60];
	// Verify this is an NT address
	if ((Data[iWinNTHdr+3] << 24 | Data[iWinNTHdr+2] << 16 
		| Data[iWinNTHdr+1] << 8 
		| Data[iWinNTHdr]) != 0x00004550)
		return false;
	Int32 iLightningAddr = iWinNTHdr + 24 + 208;
	Int32 iSum=0;
	Int32 iTop = iLightningAddr + 8;
	for (int i = iLightningAddr; i < iTop; i++)
		iSum|=Data[i];
	if (iSum == 0)
		return false;
	else
		return true;
}


Got this from a blog entry here:
http://blogs.msdn.com/adam_nathan/archive/2003/10/26/56786.aspx[^]

Hope this helps,
Nathan

---------------------------
Hmmm... what's a signature?
QuestionIs there a file properties dialog in C#? Pin
Flack3-Mar-04 12:50
Flack3-Mar-04 12:50 
AnswerRe: Is there a file properties dialog in C#? Pin
Dave Kreskowiak3-Mar-04 18:46
mveDave Kreskowiak3-Mar-04 18:46 
AnswerRe: Is there a file properties dialog in C#? Pin
Heath Stewart4-Mar-04 5:18
protectorHeath Stewart4-Mar-04 5:18 
GeneralProblem with Visual Studio .NET Pin
johnstacey3-Mar-04 10:34
johnstacey3-Mar-04 10:34 
GeneralRe: Problem with Visual Studio .NET Pin
Heath Stewart4-Mar-04 4:15
protectorHeath Stewart4-Mar-04 4:15 
GeneralRe: Problem with Visual Studio .NET Pin
johnstacey4-Mar-04 11:24
johnstacey4-Mar-04 11:24 
GeneralRe: Problem with Visual Studio .NET Pin
Heath Stewart4-Mar-04 11:27
protectorHeath Stewart4-Mar-04 11:27 
GeneralRe: Problem with Visual Studio .NET Pin
johnstacey4-Mar-04 11:36
johnstacey4-Mar-04 11:36 
GeneralRe: Problem with Visual Studio .NET Pin
pacelvi5-Mar-04 13:02
pacelvi5-Mar-04 13:02 
GeneralLogin Form using C#(Winforms) Pin
umairpasha3-Mar-04 10:32
umairpasha3-Mar-04 10:32 
GeneralRe: Login Form using C#(Winforms) Pin
joan_fl3-Mar-04 10:47
joan_fl3-Mar-04 10:47 
GeneralUse remoting to invoke a remote method Pin
Judah Gabriel Himango3-Mar-04 9:27
sponsorJudah Gabriel Himango3-Mar-04 9:27 
GeneralRe: Use remoting to invoke a remote method Pin
LongRange.Shooter3-Mar-04 10:26
LongRange.Shooter3-Mar-04 10:26 
GeneralRe: Use remoting to invoke a remote method Pin
Judah Gabriel Himango3-Mar-04 12:49
sponsorJudah Gabriel Himango3-Mar-04 12:49 
GeneralRe: Use remoting to invoke a remote method Pin
Tom Larsen3-Mar-04 11:05
Tom Larsen3-Mar-04 11:05 
GeneralLimiting window movement Pin
sixefftee3-Mar-04 9:16
sixefftee3-Mar-04 9:16 
GeneralRe: Limiting window movement Pin
John Fisher4-Mar-04 10:55
John Fisher4-Mar-04 10:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.