Jump to content
Xtreme .Net Talk

HJB417

Avatar/Signature
  • Posts

    612
  • Joined

  • Last visited

Everything posted by HJB417

  1. A ManualResetEvent for each class w/ a call to WaitHandle.WaitAll should do the trick. Each thTcpListener thread will have a ManualResetEvent and will call the ManualResetEvent.Set event when it reaches a point where the thRemote thread should continue. The thRemote thread will call WaitHandle.WaitAll which will make the thRemote thread block/wait until all thTcpListener threads have invoked ManualResetEvent.Set. http://msdn2.microsoft.com/en-us/library/z6w25xa6.aspx http://msdn2.microsoft.com/en-us/library/system.threading.manualresetevent.aspx
  2. What database are you using and what DbDataAdapter are you using? Iterate through the DataTable rows and see if there are DataRow obejct's whose RowState is Deleted.
  3. Probably need to update the browser caps http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfbrowsercapssection.asp In the past, I've just copied/pasted from http://slingfive.com/pages/code/browserCaps/ into my machine.config.
  4. http://dev.mysql.com/doc/refman/5.0/en/insert-select.html
  5. http://groups.google.com/groups/search?q=detect+usb+dotnet&start=20&ie=UTF-8&
  6. the former... make an icomparer that compares the record id, another icomparer that comapres the class id and another that compares the sort order. The reason why is, if you have a bunch of objects stored in an arraylist, you can just pass the icomparer instance to the arraylist.sort method.
  7. Have you tried using the Anchor property? http://www.c-sharpcorner.com/winforms/AnchDocInWinFormsGAG.asp
  8. imageResize.Save(ms, Imaging.ImageFormat.Bmp) you're just saving it back to the memory stream.
  9. A random guess but seeing how you're accessing the treenode for reading on a postback.. it must reconstruct the treenode and maybe that's where the issue is... It's maybe using it's builtin classes to reconstruct the treenode.
  10. why was joe mamma banned? if u cant say puiblicy just private message me why.
  11. You should look into mysqldump... try using the --compatible flag.
  12. I believe mysql has a msi installer. msi has several flags, one of them I believe is /silent. MSSQL for example supports this.
  13. parse the data from the link.
  14. Unless directory browsing is enabled, you can't =/
  15. http://msdn2.microsoft.com/en-us/library/ms190750.aspx should work in access jet.
  16. Console app. I knew the handle of a deeply nested child window. Here's code to recursively call enumchildwindow. Imports System Imports System.Collections Imports System.Runtime.InteropServices Module Module1 <DllImport("user32.dll", SetLastError:=True)> _ Function EnumChildWindows(ByVal window As IntPtr, ByVal callback As EnumWindowsProc, ByVal i As Integer) As Boolean End Function <DllImport("user32.dll", SetLastError:=True)> _ Function GetDesktopWindow() As IntPtr End Function <Serializable()> _ Delegate Function EnumWindowsProc(ByVal handle As IntPtr, ByVal i As Integer) As Boolean Private childWindows As ArrayList Sub Main() 'arraylist to store handles of found child window. childWindows = New ArrayList 'the child handle I want to look for. Dim childHandle As New IntPtr(4129470) 'search the desktop's child windows. EnumChildWindows(GetDesktopWindow, New EnumWindowsProc(AddressOf EnumerateChildProc), 0) 'output stats n facts. Console.WriteLine("Desktop has {0:N0} child window(s).", childWindows.Count) Console.WriteLine("Requested child window found: {0}", childWindows.Contains(childHandle)) End Sub Private Function EnumerateChildProc(ByVal childWindowHandle As IntPtr, ByVal i As Integer) As Boolean 'add the child window's handle to the collection. childWindows.Add(childWindowHandle) 'do stuff here if you want like check the properties of the child window 'if it's the window you want, just 'Return True' because there's no need 'to continue searching. 'do a recursive call to retrieve the child window handles of the child window. EnumChildWindows(childWindowHandle, New EnumWindowsProc(AddressOf EnumerateChildProc), 0) Return True End Function End Module Inside the EnumerateChildProc function, I would place code to determine if the childwindow is the window you want. If not, call EnumerateChildProc on the childwindow.
  17. C# dlls will be treated as com objects. It might be easier to write the dll using c++.net.
  18. The only problem with using datareaders is, I believe the values of the parameters aren't set until the datareader is closed.
  19. I think you'll need to use the COLUMNS_UPDATED function inside the trigger. Because I'm a tsql noob, I can't provide sample code =( ...Assuming you're using mssql.
  20. Assuming you're using tcp...... 1) Try disabling the nagle algorithm using setsocketoptions method. THe nagle algorithm basically prevents data from being sent immediately (think chatty clients). 2) When you finished writing your custom packet, flush the data by calling the Flush method. 3) Closing a socket will drop the connection. I believe with networkstreams though, there's a boolean indicating if it owns the underlying socket or not. If it doesn't, it won't close the underlying socket.
  21. I would use spy++ to get the handle of the window you want and then call EnumChildWindows recursively and see if it finds it. As long as the windows belong to the same application, it won't matter which thread it's in. All input is processed by one thread in gui apps... The message pump thread.
  22. I was thinking windows scheduler. To do it programatically requires using COM and the ITask interface. Task Scheduler Library for .NET
  23. I would try deriving from the ImageButton class and overriding the Render method. When you call the base class's Render method, pass in a new instance of a HtmlWriter and then remove the border attribute using regex, and writing that data to the HtmlWriter that was passed to the derived ImageButton class. E.x.: NoBorderImageButton using System; using System.IO; using System.Web.UI; using System.Text.RegularExpressions; namespace WebApplication2 { public class NoBorderImageButton : System.Web.UI.WebControls.ImageButton { protected override void Render(HtmlTextWriter writer) { //create a temporary HtmlTextWriter using(StringWriter htmlOutput = new StringWriter()) using(HtmlTextWriter tempWriter = new HtmlTextWriter(htmlOutput)) { //get the html base.Render(tempWriter); tempWriter.Flush(); string html = htmlOutput.ToString(); //rewrite the html stripping the border property html = Regex.Replace(html, "border\\s*=\\s*((\\\"\\d+\\\")|(\\d+))", ""); //write the stripped html writer.Write(html); } } } } Test aspx page <%@ Register TagPrefix="myControls" Namespace="WebApplication2" Assembly="WebApplication2" %> <%@ Page language="c#" EnableViewState="false"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD> <title>WebForm1</title> </HEAD> <form id="Form1" method="post" runat="server"> <asp:ImageButton id="aspNetImgBtn" runat="server" AlternateText="asp:ImageButton" ImageUrl="http://xtremedotnettalk.com/image.php?u=22970&dateline=1100314258"></asp:ImageButton> <br> <myControls:NoBorderImageButton id="myCustomImgBtn" AlternateText="myControls:NoBorderImageButton" ImageUrl = "http://xtremedotnettalk.com/image.php?u=22970&dateline=1100314258" runat="server"></myControls:NoBorderImageButton> </form> </body> </HTML> Rendered Html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD> <title>WebForm1</title> </HEAD> <form name="Form1" method="post" action="WebForm1.aspx" id="Form1"> <input type="hidden" name="__VIEWSTATE" value="dDw2NzE3MDk5Nzs7bDxhc3BOZXRJbWdCdG47bXlDdXN0b21JbWdCdG47Pj63uCkHDwmE/vMwiv2m5xFyR8kipw==" /> <input type="image" name="aspNetImgBtn" id="aspNetImgBtn" src="http://xtremedotnettalk.com/image.php?u=22970&dateline=1100314258" alt="asp:ImageButton" border="0" /> <br> <input type="image" name="myCustomImgBtn" id="myCustomImgBtn" src="http://xtremedotnettalk.com/image.php?u=22970&dateline=1100314258" alt="myControls:NoBorderImageButton" /> </form> </body> </HTML>
  24. There's also a .net library MySQL Connector/Net enables developers to easily create .NET applications that require secure, high-performance data connectivity with MySQL. It implements the required ADO.NET interfaces and integrates into ADO.NET aware tools. Developers can build applications using their choice of .NET languages. MySQL Connector/Net is a fully-managed ADO.NET driver written in 100% pure C#.
  25. Here's C# code that uses the "open with" dialog. ported from http://blogs.msdn.com/oldnewthing/archive/2004/11/26/270710.aspx and http://groups.google.com/group/microsoft.public.win32.programmer.ui/browse_thread/thread/8dde98bae84136fc/. using System; using System.Runtime.InteropServices; namespace ConsoleApplication6 { [serializable] public struct ShellExecuteInfo { public int Size; public uint Mask; public IntPtr hwnd; public string Verb; public string File; public string Parameters; public string Directory; public uint Show; public IntPtr InstApp; public IntPtr IDList; public string Class; public IntPtr hkeyClass; public uint HotKey; public IntPtr Icon; public IntPtr Monitor; } class Class1 { [DllImport("shell32.dll", SetLastError=true)] extern public static bool ShellExecuteEx(ref ShellExecuteInfo lpExecInfo); public const uint SW_NORMAL = 1; static void OpenAs(string file) { ShellExecuteInfo sei = new ShellExecuteInfo(); sei.Size = Marshal.SizeOf(sei); sei.Verb = "openas"; sei.File = file; sei.Show = SW_NORMAL; if(!ShellExecuteEx(ref sei)) throw new System.ComponentModel.Win32Exception(); } [sTAThread] static void Main(string[] args) { OpenAs(@"C:\odbcconf.log"); return; } } } Unfortunately, I couldn't find a way to prevent the method from returning immediately =(
×
×
  • Create New...