Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
Q

quacks_a_lot

@quacks_a_lot
About
Posts
22
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Problem reconnecting using Socket class
    Q quacks_a_lot

    That worked! Thanks a million

    C# csharp html database dotnet sysadmin

  • notification ballon tip
    Q quacks_a_lot

    How do you mean? Like how some balloon tips have a (X) Close button on the top-right corner or programmatically or are you talking about closing a balloon tip of another program?

    C# question

  • Validating IP Addresses
    Q quacks_a_lot

    I'd imagine if the Dns class returned the IP address for the hostname you were looking for (or the other way around), then that would be the correct IP address. If it is the wrong IP address, the host you are looking for either changed names or is offline.

    C# com sysadmin tools help question

  • Problem reconnecting using Socket class
    Q quacks_a_lot

    I am trying write a TCP client that connects to a server and requests HTTP packets using the Socket class. The problem I'm having is when I receive a HTTP return code of 400 (Bad Request), the server disconnects me and I have to close my connection as well. Once I close my connection, the Socket class won't let me start another TCP handshake, let alone send any more packets. Here is my code for the connection:

    ;
    Socket socket;
    IPEndPoint hostEndPoint;
    string packet;

    public void run()
    {
    TCPConnect();

    packet = SendReceive("/signin.aspx", "GET");
    if (GetReturnCode(packet) == "400")
    TCPReset();

    packet = SendReceive("/index.html", "GET");

    TCPClose();
    }

    private void TCPConnect()
    {
    // Make sure there is a connection
    if (socket == null)
    {
    socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
    hostEndPoint = new IPEndPoint(ipaddr, port);
    }

    socket.Connect(hostEndPoint);
    }

    // My problem is getting this function working properly
    private void TCPReset()
    {
    socket.Disconnect(true); // Close the socket connection and allow reuse of the socket
    socket.Connect(hostEndPoint); // This is ignored according to Ethereal,
    // nothing is sent even using socket.Send()
    }

    private void TCPClose()
    {
    socket.Shutdown(SocketShutdown.Both);
    socket.Close();
    }

    private string SendReceive(string strURI, strMethod)
    {
    string pcAppend = " HTTP/1.1\r\nConnection: Keep-Alive\r\n\Content-Length: 0\r\n" +
    "User-Agent: Mozilla/4.0 (Compatible; MSIE 7.0; Windows NT 5.2; .NET CLR " +
    "2.0.50727; .NET CLR 3.0.04506.30; InfoPath.1; .NET CLR 3.5.21022)\r\n" +
    "Content-Type: application/x-www-form-urlencoded\r\nHost: " + strIPAddress + "\r\n\r\n";
    byte[] pcSend = System.Text.ASCIIEncoding.ASCII.GetBytes(strMethod + strURI + pcAppend);
    byte[] bfBuffer = new byte[10240];

    socket.Send(pcSend, pcSend.Length, 0);
    socket.Receive(bfBuffer, bfBuffer.Length, SocketFlags.None);

    return System.Text.ASCIIEncoding.ASCII.GetString(bfBuffer);
    }

    ; I've been monitoring the commuications with Ethereal. .Net is closing the connection just fine, but it ignores any socket.Connect() calls after the initial connection. Any ideas?

    C# csharp html database dotnet sysadmin

  • call the value from the console and paste it to windows froms.
    Q quacks_a_lot

    In public static void Main(string[] args), use the parameter (args) Example: textbox.Text = args[0];

    C# tutorial winforms help question

  • How do I kill an 'access denied' process?
    Q quacks_a_lot

    So very true. Your Pentium or Pentium compatible processor has different modes that it can run in. Two of the most common are Real Mode and Protected Mode. Real Mode is a 16bit mode where one application can access and manipulate virtually everything in memory. DOS and early versions of Windows ran in Real Mode. Current operating systems run in Protected Mode. Protected Mode has 4 'rings' of protection, where Real Mode has no rings. 'Ring 0' is the ring that has access to everything. As you get into higher rings you get more and more restricted. Computer users generally have ring 2 or 3 permissions or something. That ring level does not have the rights to change its ring level. Access denied. You have to hack into the OS to do that. At that stage, whatever code you're running is a part of the 'OS' now. A screw up in coding can crash your computer or possibly even fry some hardware. This whole reply is off of memory, so if anyone notices any inaccurate information, I will not be offended by a correction.

    System Admin question com performance

  • vb.net
    Q quacks_a_lot

    I'm sure the image control will work. Scroll through its methods until you find a property or a method that you can use that will allow you to set the image's source, or URL, or path. The image control has some property or method for this. If its a method it will probably be named something like Load. To look through what properties and methods are available type: Image1. where Image1 is the name of your image control. once you press the '.' a list will pop up with all the properties and methods that you can use.

    Visual Basic question csharp database help

  • vb.net
    Q quacks_a_lot

    You can probably add a picturebox to your form and use the PictureBox1.Load(imagepath) function.

    Visual Basic question csharp database help

  • access not installed
    Q quacks_a_lot

    You probably just need the Access driver installed to run it. I think most of the newer Windows operating systems, or at least Windows XP, already have the driver installed.

    Visual Basic csharp database com question

  • Dynamic CheckBoxList Creation
    Q quacks_a_lot

    Try replacing '<=' with '<' in 'While listItemCount <= totalColNum'. If this doesn't fix it put a break inside the loop and see just how many times you are actually looping through before the error occurs. When the program reaches the break you can hold the mouse over the 'totalColNum' variable and see how many times its trying to loop.

    Visual Basic css database help question announcement

  • parse string with VBScript
    Q quacks_a_lot

    You can always use the Left function to get the first part of the string if you want to be messy. VB6 Example: strTemp = SpecialFolders(Desktop) path = Left(strTemp, Len(strTemp - 7) VB.NET Example: strTemp = SpecialFolders(Desktop) path = strTmp.Substring(0, strTmp.Length - 7)

    Visual Basic question

  • Office2003 - Set Plot Area's fill image
    Q quacks_a_lot

    Does coChartObject.Chart have a ChartArea property? I was looking around on MSDN for some help on that. Maybe this page will help you. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaxl11/html/xlmthUserTextured1_HV05205759.asp[^]

    Visual Basic question help

  • Excel controlled by VB application runs too slow
    Q quacks_a_lot

    Let me see the part of your code that you are creating the Excel application and calling some of its operations. You might be accidentally creating a new instance of you Excel app each time you make a call, or, even worse, making multiple instance of Excel. Either way would make your VB app run slow; and, if the latter, increasingly slow.

    Visual Basic question announcement

  • Adding a path to system
    Q quacks_a_lot

    This link might be useful to you: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/environment_variables.asp[^]

    System Admin windows-admin

  • combo boxes and additem command help me!! urgent!!
    Q quacks_a_lot

    You can index your combo boxes. To do this, add a combo box (e.g. combobox_days) to your form. Set its Index property to 0 or Copy, Paste, and press Yes when it asks you if you want to make an array. Do either one of these until you have all of the combo boxes you want. To add the items for the days: Dim intCount As Integer For intCount = 1 To 31 combobox_days(0).AddItem intCount 'This will add each day (1 through 31) to the 1st combo box combobox_days(1).AddItem intCount 'This will add each day (1 through 31) to the 2nd combo box combobox_days(2).AddItem intCount 'This will add each day (1 through 31) to the 3rd combo box Next intCount Or to comply with your message: Dim intCount As Integer 'This loop adds duplicate information to all combo boxes with the name of combobox_days For intCount = 0 To (combobox_days.Count - 1) combobox_days(intCount).AddItem 1 combobox_days(intCount).AddItem 2 combobox_days(intCount).AddItem 3 ... Next intCount Their is an ActiveX control named DTPicker that you can use by going to Projects, Components..., and selecting Windows Common Controls-2 6.0

    Visual Basic help

  • Get the PnP ID of USB thumdrive
    Q quacks_a_lot

    Dinakara K wrote: buf = IIf((obj.InterfaceType = "USB") And (objDrive.DriveLetter = "J"), _ obj.PNPDeviceID, "") buf = "Model: " & obj.Model & vbCrLf buf = buf & "PnP Device ID: " & obj.PNPDeviceID & vbCrLf msgbox buf Try replacing the immediate If statement with a regular If statement. Every time you go through your For...Next loop its adding Dinakara K wrote: buf = "Model: " & obj.Model & vbCrLf buf = buf & "PnP Device ID: " & obj.PNPDeviceID & vbCrLf to your buf variable no matter what is returned by the IIF statement. Besides, buf = "Model: " & obj.Model & vbcrlf is replacing whatever you had you IIF statement return.

    Hardware & Devices help tutorial

  • we need help for this project
    Q quacks_a_lot

    kenvil wrote: is it possible to imbed a code to an existing duplicate file finder? Only if you have the source code for the file finder. But then it wouldn't really be from scratch. VB6 comes with the DriveListBox, DirListBox, and FileListBox controls to get information about drives, folders, and files on the local computer. I don't think that you can set them to return information about a remote computer. You will probably have to create two apllications. A client program that runs in the background and allows the user to clean his own machine if he wishes to, and an administrator program that can connect to the client program on a remote computer. The client program will scan the computer as requested by the administrator program. The administrator can then decide what to do with the duplicate files. I don't know much about how to send this sort of information over LAN but, if you are willing to learn it, DirectPlay can probably be of use to you. If you don't like the DriveListBox, DirListBox, and FileListBox controls that come with VB, you can check out the FindFirstFile, FindNextFile, and FindClose functions of the kernel32 DLL. I've used these calls before and can send you snippets if you are interested.

    Visual Basic help

  • want to move the folder from one drive to another
    Q quacks_a_lot

    You can add a DirListBox and FileListBox to a form and set the visible property to False. These controls enumerate the folders and files on a computer. Use these controls to get the file names so that you can move them to the next drive creating folders as needed. If you don't want to add controls to your form and figure out how to use them, learn how to use the API functions FindFirstFile, FindNextFile, and FindClose in the kernel32 DLL. I can give you some examples on how to use these calls if you desire.

    Visual Basic

  • Event - After form is displayed for first time
    Q quacks_a_lot

    If you open your login screen like this: frmMain.Show 'Displays frmMain frmLogin.Show vbModal 'Displays Login form It should act like a message box, not allowing the user to access any other form. Hope this helps.

    Visual Basic question

  • TreeView Set Node to Top
    Q quacks_a_lot

    If you are trying to make a node move to the top of the TreeView: Dim tmpText As String Dim tmpChecked As Boolean TreeView1.Nodes.Remove 10 TreeView1.Nodes.Add 1, , , tmpText TreeView1.Nodes(1).Checked = tmpChecked Or if you want to make sure the user can see the node: TreeView1.Nodes(9).EnsureVisible There is probably an easier way of moving nodes. Hope this code helps you.

    Visual Basic tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups