Monday, January 3, 2011

CrazyEngineers Forum - Computer Science & IT Engineering

CrazyEngineers Forum - Computer Science & IT Engineering


Computer Science Important Resources, Tutorials & Links

Posted: 03 Jan 2011 12:23 AM PST

CEans,

I welcome you to contribute the important resources, articles, tutorials and links related to computer science and IT engineering section.

I'm making this post sticky.

Is it possible to stop a windows form panel background image from refreshing?

Posted: 02 Jan 2011 03:15 PM PST

Hello guys, I hope you are all well!

I am creating a game in Visual Studio using picture box's, but I cannot for the life of me figure out how I can have a nice picture in the background, as when I do put one in there it is constantly redrawn everytime the game refreshes and this make it impossible to play as it slows almost to a halt. My question for you pro's is, can I set the background image of the panel to never refresh?

With the amount of different things Visual Studio can do, I am sure there must be a way to achieve this simple task?

I have tried everything but I cannot figure it out, if anyone can help me I would be greatly appreciative!

Many thanks to you all!!

Cheers!!!!!!

How to check my server socket programs are correct...?

Posted: 02 Jan 2011 03:43 AM PST

hello friend's
Just started to read about socket programming.I have written a simple program for reading a file from server and write in client side.
Check this,
For server side....
Code:

import java.io.*;
import java.net.*;
public class ss
{
    public static void main(String args[])
    {
        byte b[]=new byte[60];
        try
        {
            ServerSocket s=new ServerSocket(12345);
            Socket s1=s.accept();
            File f=new File("kk.txt");
            BufferedInputStream bis=new BufferedInputStream(new FileInputStream(f));
            bis.read(b);
            OutputStream os=s1.getOutputStream();
            os.write(b);
            s1.close();
        }
        catch(Exception e)
        {
            System.out.println("Exception caught ");
        }
    }
}

For client side....
Code:

import java.io.*;
import java.net.*;
public class ss
{
    public static void main(String args[])
    {
        byte b[]=new byte[60];
        try
        {
            Socket s=new Socket("27.0.0.1",1234);
            InputStream is=s.getInputStream();
            is.read(b);
            FileOutputStream f=new FileOutputStream("monu.txt");
            BufferedOutputStream bos=new BufferedOutputStream(f);
            bos.write(b);
            bos.close();
            s.close();
        }
        catch(Exception e)
        {
            System.out.println("Exception caught ");
        }
    }
}

But the problem is that i want to check that my program working fine or not but i don't know how can i check this.
Can i use any hosting account as a server ?
If yes then what to do in order to execute this program ?

No comments:

Post a Comment