|
I have to move 10 million dollars out of the US. Can you give me your bank account details, and I'll share some with you!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I pleez to help for you?
|
|
|
|
|
cplusplus018 wrote: I dont even know where to start from
<joke>
static void Main()
{
}
</joke>
Start by gaining an understanding of the game.
Replicate the objects in the game, players etc as classes.
Create the logic that governs the game play and interacts with the objects - test this stage thoroughly!
Draw the GUI to retrieve information from the user(s) and the game status if apropriate.
|
|
|
|
|
hi,
I am using an aspxgridview and two checkboxes(for header and dataitem).When I check header checkbox I want to check all checkbox.I am also using java script code.essentially, I can do this, but I must check header checkbox twice times.I didnt understand why it is happening.ı am writing this code checkbox_checked event and header checkbox's autopostpak is true. When I used normal gridview I didnt have any problem I could do this without problem.,
<script language="javascript" type="text/javascript">
function SelectAll(id) {
var IsChecked = id.checked;
var Chk = id;
// Parent = document.getElementById('GrdPerliste');
Parent = document.getElementById('<% = GrdPerliste.ClientID%>');
var items = Parent.getElementsByTagName('input');
for (i = 0; i < items.length; i++) {
var deneme = items[i].type;
if (items[i].id != Chk && items[i].type == "checkbox") {
if (items[i].checked != IsChecked)
{ items[i].click(); }
}
}
}
</script>
protected void Checksec_CheckedChanged2(object sender, EventArgs e)
{
CheckBox chk = (CheckBox)sender;
GridViewHeaderTemplateContainer bulundugucontainer = (GridViewHeaderTemplateContainer)chk.NamingContainer;
((CheckBox)bulundugucontainer.FindControl("Checksec")).Attributes.Add("onclick", "javascript:SelectAll('" + ((CheckBox)bulundugucontainer.FindControl("Checksec")).ClientID + "')");
}
|
|
|
|
|
try this javascript function
function SelectAll(cntrl,grd,indCat)
{
var grdComp = document.getElementById(grd);
if(indCat == '1')
{
for(i=1;i<=grdComp.getElementsByTagName('input').length-1;i++)
{
grdComp.getElementsByTagName('input')[i].checked = cntrl.checked;
}
}
else if(indCat == '2')
{
var chkInd = true;
for(i=1;i<=grdComp.getElementsByTagName('input').length-1;i++)
{
if(grdComp.getElementsByTagName('input')[i].checked == false)
{
chkInd = false;
}
}
grdComp.getElementsByTagName('input')[0].checked = chkInd;
}
}
hope this helps
with regards
Karthik Harve
|
|
|
|
|
thanks for your answer but my problem is that I have to check header checkbox twice.this works only when I check twice so when it works,header check seems not check
|
|
|
|
|
Hi,
I really need help with this...
I need to write c# app (from windows)that will connect to Linux virtual machine server(SLES 10)
with the following information for example:
VM server : example01.xx.example.com
Userid: rrrr
Pssword: rrrr
How can i do it?
all the example that i saw i for connection with TCP.IP address and with port.
Can someone provide me a simple example of C# code for connection to such a Linux server from windows app?
|
|
|
|
|
ronensv wrote: all the example that i saw i for connection with TCP.IP address and with port.
Can someone provide me a simple example of C# code
And the reason that you are unable to use TCP is?
Maybe you can explain what it is that you are trying to connect to? What is it on the Linux side that is waiting for you to connect to it?
And please do not cross post.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
modified 20-Apr-12 7:26am.
|
|
|
|
|
|
I am sure that the OP would need the links more than I
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
sorry, that links are really for him, but i decided to send all in one post and messed with my bad english =p
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
|
|
|
|
|
Thanks for you answer,
I was never implement communication between client to server.
I am now work on big project and i asked to make module that will send strings to the Linux server and then the server will received this strings and will do some calculation and send to the the client(app in windows) string back.
now i need to write the code in the client(c# app) and also the code on the server.
i dont understand how to connect to the server and send to it strings (i understand that i need to write code that catch this sting in the server side).
i just know the server name,the user_id and password.
but all the example that i see require tcp/ip address and port, and i dont understand how to make the connection if i dont have the tcp/ip adders and the port...
sorry if my question seems stupid...but i never used client- Linux server communication
|
|
|
|
|
again, you HAVE the ip of the server, you have their hostname, which can be translated into an ip with the DNS class, take a look:
"a brief explanation about DNS from microsoft: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682100(v=vs.85).aspx[^]
documentation of the class you are looking for: http://msdn.microsoft.com/en-us/library/System.Net.Dns.aspx[^]
you can get your own fish now."
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
|
|
|
|
|
ronensv wrote: now i need to write the code in the client(c# app) and also the code on the server.
Then you are in charge of determining the protocol.
ronensv wrote: i dont understand how to connect to the server and send to it strings (i understand that i need to write code that catch this sting in the server side).
i just know the server name,the user_id and password.
You are confusing issues.
1. Connection
2. Security
Two different things.
If you have a user/pwd then the reason is because the server code uses it. If the server code doesn't use it then you don't need it.
Since you are writing the server code you get to decide whether to use it or not. And if you do use it then you are also defining how to use it.
You might also want to just write a C# client server TCP connection simple test.
Get that to work.
Then write the same code in C++ (presumably) for the linux box: both client and server.
Get that to work (only on linux.)
If you did the two correctly then you should be able to use the client on one OS and the server on the other and they will just work.
|
|
|
|
|
I've a types class, which contains key and value properties and I need to send array of types objects to restful service. I tried the below url, but its not working. Please correct it. Thanks in advance.
http://localhost:8080/CRService/services/CRService/newRequest?User=abcd&types={"key":name, "value":xyz}&types={"key":assigned_to, "value":abcd}&types={"key":status, "value":COMPLETED}
|
|
|
|
|
var servers = new List {
new DatabaseSystem { ServerName = "ANTIVIRUS" },
new DatabaseSizes { ServerName = "ANTIVIRUS"},
new DiskBackup { ServerName = "ANTIVIRUS"},
new SqlServerEventLog { ServerName="ANTIVIRUS"},
new DiskSystem { ServerName="ANTIVIRUS"},
new DatabaseSystem { ServerName="SEJKG-S-DB01" },
new DatabaseSizes { ServerName = "SEJKG-S-DB01"},
new DiskBackup { ServerName = "SEJKG-S-DB01"},
new SqlServerEventLog { ServerName="SEJKG-S-DB01"},
new DiskSystem { ServerName="SEJKG-S-DB01"},
};
var builder = new ContainerBuilder();
builder.RegisterInstance(notifiers).As>();
builder.RegisterInstance(servers).As>();
builder.Register(c => new ServerChecker(c.Resolve>(), c.Resolve>()));
return builder.Build();
I have a problem with how I should register my "where server = new List {..} 'to the Container Builder. My List of iChecker passed as a parameter to a ServerChecker. So much have I been able to solve, but not the list itself but I must have outside. The usual list of servers is much greater.
|
|
|
|
|
You're most likely never going to get an answer about this here. It's unlikely, in the extreme, that anyone who has ever used that library will ever see your question here.
You're best bet would be to contact the people that wrote the library you're using.
|
|
|
|
|
I have searched forums, Google, etc. and the examples provided do not work.
This is for a project I am working on.
The issue is creating event handler for click event
all else works and displays the pictureBoxes correctly
Code Snippet.
PictureBox pic = new PictureBox();
pic.Height = 150;
pic.Width = 150;
pic.Image = Utility.getPhoto(intPicID);
// get System.Drawing.Image from Picture Table
pic.Location = new System.Drawing.Point(intLeft, intTop);
pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
strBoxName = "PictureBox" + Convert.ToString(intW);
pic.Name = strBoxName;
pic.AllowDrop = true;
pic.TabStop = false;
pic.BorderStyle = BorderStyle.None;
if (clsGlobals.gbBorderStyle)
{
pic.BorderStyle = BorderStyle.Fixed3D;
}
//pic.Click += new System.EventHandler(pic_Click);
// if the preceeding line is un-commented the message
// the name pic_Click does not exist in the current context
clsGlobals.gstrPictureBoxNames[intW - 1] = pic.Name;
intW++;
PicBoxList.Add(pic);
}
// end of if
}
// end while
foreach (PictureBox pic in PicBoxList)
{
this.Controls.Add(pic);
//pic.Click += new System.EventHandler(pic_Click);
}
directives
using System;
using System.Windows;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
using System.IO;
using System.Data.SqlClient;
using System.Web;
|
|
|
|
|
Member 8572197 wrote: pic.Click += new System.EventHandler(pic_Click);
So where is your method...
private void pic_Click(object sender, EventArgs e)
{
}
?
|
|
|
|
|
Dave,
thanks!
one more question
Is it it possible to put a string variable inside the ( ) I have up to 36 possible EventHandlers to create.
Pete
|
|
|
|
|
I'm not sure what you mean. If you could explain what you wish to achieve more thoroughly then I may be able to suggest how you can do it.
|
|
|
|
|
Dave,
I have a form that can have a differing number of pictureboxes dynamically created on it. The number can vary from 9 to 36. The statement pic.Click += new System.EventHandler(pic1_Click); will work in the loop for one event, I need to create event for somewhere between 9 and 36 events on the fly, based on what was selected. Everything else is handled in my loops except the event creation. I can use a giant switch/case, but I would like to use a variable of some sort to place where I have pic1_Click in the event handler statement, if that is possible.
I hope this explains the issue better.
Thanks,
Pete
|
|
|
|
|
No, that isn't possible - but it doesn't sound like a good way to me anyway. The += needs a EventHandler delegate instance as a parameter. This can be done by using either an existing instance, a new instance or just a method name with the correct signature.
Have you considered an alternative aproach - and using one event handler for all the picture boxes?
You can attach the event handler to all PictureBox es in a simple loop:
foreach (Control control in this.Controls)
if (control is PictureBox)
control.Click += PictureBoxClickHandler;
and your handling method would start like this:
private void PictureBoxClickHandler(object sender, EventArgs e)
{
PictureBox pictureBox = sender as PictureBox;
if (pictureBox != null)
{
}
}
You can now use any property (perhaps Name as you want to use strings, the Tag property is designed for this though) to identify the picture box in question and react as you wish. I usually prefer to subclass the control and add an Id property:
public class MyPictureBox : PictureBox
{
private int id;
public int Id
{
get { return id; }
set { id = value; }
}
}
foreach (Control control in this.Controls)
if (control is MyPictureBox)
control.Click += MyPictureBoxClickHandler;
private void MyPictureBoxClickHandler(object sender, EventArgs e)
{
MyPictureBox myPictureBox = sender as MyPictureBox;
if (myPictureBox != null)
{
switch (myPictureBox.Id)
{
case 1:
break;
case 2:
case 3:
break;
default:
break;
}
}
}
[Edit] You would obviously need to use MyPictureBox es instead of the built in PictureBox . After a build, it will show in your toolbox for drag and drop - or you can just change the code where they are created.
|
|
|
|
|
Dave,
Thanks, I will try your methodology, it looks pretty easy.
Pete
|
|
|
|
|
Hi,
I'm new in c# but have a bit of knowledge in c++ and vb.net. I have a small assignment here of writing a simple game in c#. The game consists of a single player who can move left or right. It also has the raindrops which appear in random position in the top quarter of the screen vertically.
The objective of the game is to move the player so that he dodges the raindrops. If raindrop touches the player then the game is over.
I understand c# code but my problem is on making the graphics/animation. How can I create the falling raindrops and the player moving horizontally across the screen?
Your help is highly appreciated.
|
|
|
|