• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Clan CDH

#1
Java Programming / 2 Quick Applet Questions
September 08, 2008, 09:30 PM
1.  I need to create a moving eye and have it follow the mouse cursor.  My teacher said we're going to have to be doing this in a few weeks but I've been sitting in class doing nothing b/c I'm already done with our assignments.  He said something about using distance formula, but wouldn't you use Tan, Sin, or Cos?

Oh, and how does one go about creating a text box?


Thanks!
-Aaron
#2
Quote from: MyndFyre[vL] on February 03, 2008, 11:15 PM
Lucky for you I just blogged about the Disposable pattern.  Hopefully it'll make a little more sense.

But, like I said, there's nothing to dispose in your class.  Since its only member is static, you never have an instance to dispose.  You should just drop IDisposable in this case.

My only problem is when I drop the IDisposable it returns the error "The name 'getsocket' does not exist in the current context."  And that blog confuses me somewhat, so I'm still a little puzzled.
#3
Thanks for the idea MyndFyre, but I want to try and get this to work before I try something else out.  I haven't had any experience "disposing" of objects, so if someone could point me in the right direction upon how I could get this to work, I would be forever grateful.
#4
For the client I am working on, it will not compile due to this error:
QuoteError  'GetSocket' does not implement interface member 'System.IDisposable.Dispose()'

And here is my code so far:
Quotenamespace firstClient

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
           
        }
        private void button1_Click(object sender, EventArgs e)
        {
            // In this code example, use a hard-coded
            // IP address and message.
            getsocket(Connectsocket(textHost.Text, Int32.Parse(textPort.Text)));
        }
    }
}
public class GetSocket : IDisposable
{
    private static Socket ConnectSocket(string server, int port)
    {
        Socket s = null;
        IPHostEntry hostEntry = null;

        // Get host related information.
        hostEntry = Dns.GetHostEntry(server);

        // Loop through the AddressList to obtain the supported AddressFamily. This is to avoid
        // an exception that occurs when the host IP Address is not compatible with the address family
        // (typical in the IPv6 case).
        foreach (IPAddress address in hostEntry.AddressList)
        {
            IPEndPoint ipe = new IPEndPoint(address, port);
            Socket tempSocket =
                new Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp);

            tempSocket.Connect(ipe);

            if (tempSocket.Connected)
            {
                s = tempSocket;
                break;
            }
            else
            {
                continue;
            }
        }
        return s;
    }
}
#5
Yeah, I was really immature at the time when I posted that and I lied a lot.


My apologies.  And I just want the client to send commands I had pre-defined in my code.

Something such as when the client says "doMsgBox" and the server looks something like this:

if(command == "doMsgBox")
{
     MessageBox(etc...)
}

And thanks for the suggestion on the Media Player.


Thanks again.
#6
My first language was VB, I soon forgot the language after I took a course of Java at my school.  I found it to be quite interesting and much better.  However, I started doing quite a bit of C# and have much more experience in it.  But I'm not too sure as how to go about this next program I plan on writing.

So here is what I want to do.  I wish to simply set up a Server/Client interface using C#, and then possibly figure out how to control a media player such as Winamp (i.e. like FoxyTunes).


Any help/suggestions is much appreciated!
#7
Quote from: topaz on January 10, 2007, 05:39 PM
Quote from: Clan CDH on January 10, 2007, 03:43 PM
I know this, but how would I go about doing this programatically?

loles, "programatically"

prick
#8
Quote from: MyndFyre[vL] on January 10, 2007, 02:04 AM
To edit the file permissions, ensure that you can do this through the Windows UI by going into Folder Options (Control Panel), and under the "View" tab, un-check "Use Simple File Sharing (Recommended)".  Then, navigate to the file, right-click and choose "Properties."  Select the "Security" tab.  Select the "Everyone" group - if "Everyone" is not a list option in the top list, click "Add" and type "Everyone" (without the quotes) and click OK.  Then, select the "Everyone" entry, and check the box in the column labeled "Deny" for the permission "Read and Execute". 

In the Registry Editor, select the key or keys related to the service.  Right-click and select "Permissions...".  Select "SYSTEM" and choose "Deny" for the "Full Control" permission set.

I know this, but how would I go about doing this programatically?
#9
How would I go about changing the permissions on this?
#10
I am writing another removal tool using Visual Basic and this virus loads as a service and protects it self. It can not be shutdown via safemode nor can it be via services.msc. So I need to make something that can kill this service. Does anyone know how I would go about writing it to kill a PROTECTED service? And no, setting the process token to SeDebugPriveledges does not help.
#11
basically I want when the dll is loaded to execute files, kinda like in just a standard exe it would be something like this

Quote
Private Sub Form_Load()
Shell("notepad.exe"
End Sub

edit:
would this have to be made in something like c,c++, or c# by any chance?
#12
Visual Basic Programming / Executing An EXE From DLL
December 01, 2006, 08:54 PM
How would I do this via a dll made in VB6???
#13
Visual Basic Programming / Re: Attributes
November 25, 2006, 12:49 PM
Quote from: FrostWraith on November 24, 2006, 11:48 PM
Quote
God you are so newb.

Your the one using VB


Hehe, that was newbish advice, and VB6 wasn't my first language, I was using it because it's "Basic" and quick to code in.
#14
Visual Basic Programming / Re: Attributes
November 24, 2006, 08:56 PM
Quote from: FrostWraith on November 21, 2006, 09:58 PM
Me.Hide
Me.Show

God you are so newb.

Quote
I think he was looking for this:

Public Sub HideFile(ByVal FilePath As String)
     Call SetAttr(FilePath, vbHidden)
End Sub

Public Sub UnhideFile(ByVal FilePath As String)
     Call SetAttr(FilePath, vbNormal)
End Sub


Thanks again shadow, it worked perfectly.
#15
Visual Basic Programming / Re: Attributes
November 21, 2006, 09:41 PM
come on, someone must know!