|
You don't seem to understand the Web paradigm. How a client (Browsers) uses HTTP to get a HTML resource, parse that to find other resources embedded in that HTML and make further HTTP requests to get those resources.
Since you have created an application that is responsible for dealing with that subject, it might be a good idea if you, the developer, studies the subject. What do you think?
|
|
|
|
|
Hi everyone!
I would like the checkedlistbox control to change the checked state of an item only if I click on the checkbox. Is there a (not too difficult) way to do that? Thanks in advance!
Istvan
|
|
|
|
|
The only thing I can think of is to set the SelectionMode to None. Now, in the mouse click event, get the location of click. If it is on the checkbox, programmatically check the item.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
You have to use HitTestInfo function to check current mouse position and then automatically check or uncheck the box.
Sorry, this method doesn't works with CheckedListBox control.
|
|
|
|
|
I have recently been working on a project intended to lock (and / or hide) directories in Windows in some manners. Now the problem isn't actually coding it, but some strategies that I might use in order to achieve this.. What to look for?
((What I have currently implemented are simply the rename functions of folders in order to make them look like Control Panel / My Computer etc etc. And then the attributes (setting them as hidden / system / read-only)...
I also had in mind 'zipping' a folder or a similar technique with a password or encryption from program-side or maybe adding an image to the 'zipped' file in order to make it look more 'innocent' but I don't know about that yet.))
Preferably it's something that can be achieved quickly (such as the attributes technique) rather than 'zipping' which takes quite some time - according to file size... Thanks!
|
|
|
|
|
Trapper-Hell wrote: in order to make it look more 'innocent'
I know exactly what you mean!
This is really a function of the filesystem, not a specific program per se. For example, NTFS allows you to protect directories.
You could, however, encrypt all files in a directory from your program. There are lots of classes which deal with cryptography in the framework.
|
|
|
|
|
Trapper-Hell wrote: What I have currently implemented are simply the rename functions of folders in order to make them look like Control Panel / My Computer etc
Deception is not a safe protection method...
Trapper-Hell wrote: And then the attributes (setting them as hidden / system / read-only)...
There is no read-only attribute on folders.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi All
I have an application where I am using a seperate thread to create a report. I created a public class with custom events etc for the threads to comunicate. I set up the events in my UI, but when the events are triggered by the report thread, the UI thread gets upset about it being caused by a different thread.
Please can somebody tell me how to get the UI to stay happy when the events are triggered??
Thanks,
oooo, the Jedi's will feel this one....
|
|
|
|
|
Google broken today? No, I didn't think so. A quick search for 'cross thread calls' revealed a list of links - this one[^] on code project looks promising.
It definitely isn't definatley
|
|
|
|
|
|
To learn about Threads, Synchronous and Asynchronous calls to UI Thread, using delegates and events to communicate between threads is best explained in this article. I learnt thread reading and running the demo project, Its the Best.
http://www.codeproject.com/KB/cs/workerthread.aspx[^]
Regards,
Karmendra
|
|
|
|
|
That was all good stuff. Thank you everybody.
oooo, the Jedi's will feel this one....
|
|
|
|
|
Hi.
Dynamically create column (All columns should be equal size)
in tableLayoutPanel when button click
But i was coded such us
this.tableLayoutPanel1.AutoSize = true;
this.tableLayoutPanel1.RowCount = 10;
this.tableLayoutPanel1.ColoumCount = 3;
// code is inside the button
this.tableLayoutPanel1.ColoumCount+=1;
This code is create a column dynamically, but that column
not have a size . How can handle this problem
Thankyou.
|
|
|
|
|
try tableLayoutPanel1.ColumnStyles.Add
|
|
|
|
|
Thankyou very much........
|
|
|
|
|
Hi, i don't understand the error i encountered when using a parameterized Stored Procedure in my Crystal report.... below is my coding:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
public partial class _Default : System.Web.UI.Page
{
private ReportDocument CreateCrystalReportDocument()
{
ReportDocument rpt = new ReportDocument();
string reportPath = Server.MapPath("MyCrReport.rpt");
rpt.Load(reportPath);
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = @"MyServer";
connectionInfo.DatabaseName = "MyDatabase";
connectionInfo.UserID = "MyUserId";
connectionInfo.Password = "MyPassword";
Tables tables = rpt.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
{
TableLogOnInfo tableLogonInfo = table.LogOnInfo;
tableLogonInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(tableLogonInfo);
}
ParameterField paramField;
ParameterDiscreteValue discreteVal = ParameterDiscreteValue();
//the next line encounters an error occur
// 'crystalReportViewer1.ParameterFieldInfo is NULL'
paramField = crystalReportViewer1.ParameterFieldInfo["@boardTitle"];
//-----------------
//the next line did not encounter error on this line but an
//error occur after exiting
// this method === error value expected at parameter "@boardTitle"
// paramField = rpt.ParameterFieldInfo["@boardTitle"];
discreteVal.Value = "Sample";
paramField.CurrentValues.Add(discreteVal);
return rpt;
}
private void Page_Init(object sender, EventArgs e)
{
ReportDocument rpt = null;
rpt = CreateCrystalReportDocument(null, "ProductName");
CrystalReportViewer1.ReportSource = rpt;
}
}
anybody who can correct my coding.... thank you in advance to those who can help...
xxx
|
|
|
|
|
Hi All,
I'd like to ask You, if someone solve the problem with rapidshare download on premium account?
I tried to download some file, but instead of real file (e.g .zip file) I have .html file downloaded.
I found few posts on board about this toppic, but did't find solution.
I'll be very thankfull for Ur help.
Thank You in advance.
Bartosz.
|
|
|
|
|
Hi all,
How to add a close button to System.Windows.Forms.ToolTip ?
Please help me.
Thanks in advance
San
|
|
|
|
|
Standard tool tip don't have close button. You need to create your own tool tip by deriving from System.Windows.Forms.ToolTip and setting OwnerDraw as true . Handle the draw event to add your code.
|
|
|
|
|
I there any sample code available?
|
|
|
|
|
Well, I got one here[^]. It shows how to create owner drawn tooltip.
|
|
|
|
|
Maybe better use customised MessageBox with buttons.
|
|
|
|
|
I have developed a simple client/server app which echoes whatever text the clients sends to the server.
Currently, it echoes text only to one client, which has send the text, but I want it to send to all the clients connected.
The problem is that when one client writes to the server after that the client waits for receiving and as soon it has received the echo it starts writing to the server, so if some other client sends to the server, and the server echoes back to all the clients, only those will receive the message which are waiting for reading, but none are except the client which has send the message to the server.
So how to overcome this?
Btw, it is a console application, is it possible to do in it?
I guess I explained it correctly. If not, then please ask again
@Mustufa: Sorry if you got annoyed of the earlier posts, I was confused converting C++/CLI to C# and posted the wrong code.
The code is
For server
using System;
using System.Net;
using System.Net.Sockets;
using System.IO;
using System.Threading;
using System.Collections;
using System.Text;
public static class GlobalMembers
{
public const int ECHO_PORT = 8080;
internal static void Main()
{
try
{
TcpListener clientListener = new TcpListener(ECHO_PORT);
clientListener.Start();
Console.WriteLine("Waiting for connections...");
while (true)
{
TcpClient client = clientListener.AcceptTcpClient();
ClientHandler cHandler = new ClientHandler();
cHandler.clientSocket = client;
Thread clientThread = new Thread(new ThreadStart(cHandler.RunClient));
clientThread.Start();
}
clientListener.Stop();
}
catch (Exception e)
{
Console.WriteLine("Exception: " + e);
}
}
}
public class ClientHandler
{
public TcpClient clientSocket;
public static Hashtable users = new Hashtable(30);
public void RunClient()
{
StreamReader readerStream = new StreamReader(clientSocket.GetStream());
NetworkStream writerStream = clientSocket.GetStream();
string returnData = readerStream.ReadLine();
string userName = returnData;
users.Add(userName, clientSocket);
Console.WriteLine("Welcome " + userName + " to the Server");
while (true)
{
returnData = readerStream.ReadLine();
string tempData = returnData.ToLower();
if (tempData.IndexOf("quit") > -1)
{
Console.WriteLine("Bye Bye " + userName);
break;
}
Console.WriteLine(userName + ": " + returnData);
returnData += "\r\n";
Byte[] dataWrite = Encoding.ASCII.GetBytes(returnData);
TcpClient[] tcpClients = new TcpClient[users.Count];
users.Values.CopyTo(tcpClients, 0);
for (int i = 0; i < tcpClients.Length; i++)
{
NetworkStream tempWriteStream = tcpClients[i].GetStream();
tempWriteStream.Write(dataWrite, 0, dataWrite.Length);
}
}
clientSocket.Close();
}
}
I store every connected client and then send data to it, but at that time is waiting for input, that is, it is waiting for the Console::ReadLine() func.
For client
using System;
using System.Net;
using System.IO;
using System.Net.Sockets;
using System.Text;
public class EchoClient
{
const int ECHO_PORT = 8080;
public static void Main(string [] arg)
{
Console.Write("Your UserName:");
string userName = Console.ReadLine();
Console.WriteLine("-----Logged In----->");
try
{
TcpClient eClient = new TcpClient("127.0.0.1", ECHO_PORT);
StreamReader readerStream = new StreamReader(eClient.GetStream());
NetworkStream writerStream = eClient.GetStream();
string dataToSend;
dataToSend = userName;
dataToSend += "\r\n";
byte[] data = Encoding.ASCII.GetBytes(dataToSend);
writerStream.Write(data,0,data.Length);
while(true)
{
Console.Write(userName + ":");
dataToSend = Console.ReadLine();
dataToSend += "\r\n";
data = Encoding.ASCII.GetBytes(dataToSend);
writerStream.Write(data, 0, data.Length);
if (dataToSend.IndexOf("QUIT") > -1)
break;
string returnData;
returnData = readerStream.ReadLine();
Console.WriteLine("Server: " + returnData);
}
eClient.Close();
}
catch(Exception exp)
{
Console.WriteLine("Exception: " + exp);
}
}
}
|
|
|
|
|
Ahmed Manzoor wrote: so if some other client sends to the server, and the server echoes back to all the clients, only those will receive the message which are waiting for reading, but none are except the client which has send the message to the server.
Client should run two threads, one for writing text to server and one for reading the text. So client will be always ready to read.
|
|
|
|
|
Well if it runs two threads, and on the write thread it is waiting for the Console::ReadLine()
At the same time the read thread prints a line, where will it be printed?
What will happen to the Console::ReadLine() func in the write thread? will it be abandoned?
|
|
|
|