|
Thanks for your reply...here is a little more information to clarify.
Im not sure what i wanna do quite yet I can see alot of possibilities though.
But for an example:
An online chessgame. I want to enable my program to play automatically.
For that to be possible i see a few problems that needs to be solved.
1. The program must gather the information from the screen, that should be quite easy to do with the method you posted above.
2. The program needs to analyze the information on the screen. In this example it needs to recognize the chessboard, the chesspieces and probably something else.
3. The program needs to calculate the best move.
4. The program need to interact with the chess program.
1,3 and 4 i think i know how to handle. But i dont know how to handle the second problem.
So what im asking about is probably links or information on how to interpet the information of the screen (bitmap)
kind regards,
Anders
|
|
|
|
|
Dear Mr. Anders,
I see what you're talking about now, you're wanting your bot to interact with the Internet. This does seem VERY difficult. My approach (but I have no idea how to do what you're doing) would be to create a program for each scenario. For instance, using Chess, at GameKnot, you know how their board looks, and how the source code for those boards look, so you could have your program get the source code for the current page (the chess game you're playing currently, although this IS cheating acccording to Gameknot regulations, so don't do it there), then calculate the best move, then to put in its move, it would perhaps have to simulate clicks based on where it thinks the squares are. The other option is to see what the code for a click is in the webpage, and somehow make the webpage think you clicked on the desired square...I'm really clueless. Good luck!!
In Christ,
Aaron Laws
http://ProCure.com
|
|
|
|
|
This is exactly what i want to do. But it dont have to be a chessgame, that was just an example.
The problem i face at the moment is that i dont know where to start. Sure i can get a screenshot of the chessboard, but then what? How do code something that recognizes the board and chesspieces?
Im assuming that it would be very error prone and ineffective to compare every pixel with presaved images (of the chesspices) and try to make my "virtual" chessbord that the computer understand.
So...if anyone know how to interpet images and translate them to something that the computer understand and can calculate i would be very grateful. Link, examples, anything is of interest
Kind regards,
Anders
|
|
|
|
|
Hey guys I have a problem in retriving the cell data from the gridview...Though I had tried with selected index change and row commands........the value it gives is just null...........here is the code
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
int row_index = int.Parse(e.CommandArgument.ToString());//gives index of the row
string _commandName = e.CommandName;
Label1.Text = Info_DGV.Rows[row_index].Cells[1].Text.ToString();
}
|
|
|
|
|
hi everyone,i'm a beginner,this is my question;
make DATA show on treeview Automatically
for exeample
Field "class1" and "class2" is in Database "STUDENT"
a、b、c、d,four students are Belong to class1
e、f、g、h,four students are Belong to class2
class1 and class2 as father node
8 students as son node of each father node
how could it show on treeview Automatically?
and when click every student it will Trigger some Matter
please show me the code
Grateful for everyone!
|
|
|
|
|
Hi,
this is not a "show me some code" site, this is a site where people who got stuck at a specific point show the relevant part of their code and then get help.
Seems like your problem needs to fetch and iterate over all students, and add nodes such as class1/student1 and class2/student5 to the TV. Basically it is similar to this example[^], however it is simpler in that there are only two levels involved.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Open up your Visual Studio and try something. If you get stuck up somewhere, then come back and ask for help. We would be happy to help you then
|
|
|
|
|
|
Hi everyone, I have a problem. Some of my code only works when debugging with breakpoint on it. Anyone knows the reason?
By the way I'm newbie in this area so maybe I made stupid little error.
private void timer1_Tick(object sender, EventArgs e)
{
if (tcpListener.Pending() == true)
{
hostSocket = tcpListener.AcceptSocket();
if(hostSocket.Poll(1, SelectMode.SelectRead))
{
int numBytes = hostSocket.Available;
Byte[] data = new Byte[numBytes];
hostSocket.Receive(data);
timer1.Stop();
string msg = System.Text.ASCIIEncoding.ASCII.GetString(data);
string[] co = msg.Split(' ');
Console.WriteLine(msg);
}
}
}
modified on Monday, November 9, 2009 5:53 AM
|
|
|
|
|
Hi,because you've put the data receiving code in the 'if(tcpListener.Pending()){} statement this only works when you put a breakpoint on it. That is because only then the client has the time to send data before the next time the timer fires an event and the tcpListener.Pending() returns false.
This should solve it:
if (tcpListener.Pending() == true)
{
hostSocket = tcpListener.AcceptSocket();
}
else if (hostSocket != null)
{
if (hostSocket.Available != 0)
{
int numBytes = hostSocket.Available;
Byte[] data = new Byte[numBytes];
hostSocket.Receive(data);
string msg = System.Text.ASCIIEncoding.ASCII.GetString(data);
string[] co = msg.Split(' '); Console.WriteLine(msg);
timer1.Stop();
}
}
Regards
|
|
|
|
|
Thanks, Jorgdedecker.
It works like a charm
|
|
|
|
|
When I double click an *.xsd file in Visual Studio 2008 I only got the markup code. When I rightclick and choose “View Designer” I only got a blank page. I’ve tried to repair the installation and installed SP1. Any tip what can be done?
_____________________________
...and justice for all
|
|
|
|
|
Hi Team,
I have a functional requirement in C#.net to develope a plug-ins and implement in outlook.
Could any body help me out from this scenario from high level or code level context.
Thanks in Advance.
Regards
Tarun Singh
Sr. Software Engineer.
mailto:tksingh@zenta.com
|
|
|
|
|
codeproject_Tarun wrote: I have a functional requirement in C#.net to develope a plug-ins and implement in outlook.
This[^] was not too difficult.
|
|
|
|
|
could you provide the way of technical approach toward achieve this.
Regards
Tarun Singh
Sr. Software Engineer.
mailto:tksingh@zenta.com
|
|
|
|
|
codeproject_Tarun wrote: could you provide the way of technical approach toward achieve this.
Well I gave you a link to a number of examples showing what you asked for, so I don't know what more you expect.
|
|
|
|
|
Hi.
I have 2 applications:
One is simple windows application and the other is web service.
They are both on the same machine, windows server 2003 - SP2.
exactly the same code in both:
X509Certificate Cert = X509Certificate.CreateFromCertFile("...some path\\export.cer");
HttpWebRequest Request = (HttpWebRequest)WebRequest.Create("https://...some URL...");
Request.ClientCertificates.Add(Cert);
Request.UserAgent = "Client Cert Sample";
Request.ProtocolVersion = HttpVersion.Version11;
Request.KeepAlive = true;
Request.Method = WebRequestMethods.Http.Post;
..
byte[] postBytes = Encoding.ASCII.GetBytes(strRequest);
System.IO.Stream requestStream = Request.GetRequestStream();
requestStream.Write(postBytes, 0, postBytes.Length);
requestStream.Close();
..
HttpWebResponse Response = (HttpWebResponse)Request.GetResponse();
In the windows application (running under logged in user) - I get response and all OK
In the web service (running under NETWORK SERVICE) - I get errors:
{"The underlying connection was closed: An unexpected error occurred on a send."}
{"Authentication failed because the remote party has closed the transport stream."}
Checking with the other side (who gets my requests) it seems like when I'm sending from the windows application they get the request with the certificate and in the case of web service they get the request without the certificate.
In the machine that sends the both requests, in the certificate store, the certificates are stored in: "Certificates (Local Computer) --> Personal --> Certificates".
Any ideas why is one sending the certificate and the other doesn't?
|
|
|
|
|
It depends on what account your web service is configured to run. Since you have stored your certificates in the personal store (which I believe is unique for each account), the account under which your web service runs does not find the certificate or does not have the appropriate access permissions to read it.
|
|
|
|
|
from emptbl: only name is vimla and his mobile number
|
|
|
|
|
What does this mean ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
SELECT name, mobile FROM emptbl WHERE (name = 'Vimla')
|
|
|
|
|
How on earth did you manage to interpret that?
|
|
|
|
|
it happens
|
|
|
|
|
|
On one machine [A] in local network there is SQL server 2005 express installed.
The connection string is:
"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\dbs\database.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
I need to connect to that db from another machine [B] on the local network.
I changed . to SQL server machine IP. But got Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' error
I also tried to add
User Id=myUserName;Password=myPassword but have the same error with user name and password of the user on machine [A]
How to provide access from machine [B] to the SQL server on machine [A]
I'm coding C# service application, not ASP.NET site
Чесноков
|
|
|
|