|
Feel free to send me email, although I can't guarantee a swift response. You're better off posting in this forum or in microsoft.public.dotnet.framework.
/ravi
|
|
|
|
|
Hi guys.
How can we change TreeView's node icon?
Do you know ?
|
|
|
|
|
Its a little wierd, but here it is:
this.treeView1.ImageList = new ImageList();
this.treeView1.ImageList.Images.Add("car", new Bitmap("C:\\Car.bmp"));
TreeNode myNode = new TreeNode("Car Node");
myNode.ImageKey = "CaR";
this.treeView1.Nodes.Add(myNode);
You can also set the ImageIndex of the node instead, so if you set this to 0 the node will use the first image in your image list, and if you set it to 1 it will use the second and so on.
Also, you will probably want to set the nodes SelectedImageKey unless if you want to use a different image when the node is selected.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
modified on Monday, May 19, 2008 9:24 PM
|
|
|
|
|
Use the:
treeView1.SelectedImageKey
property.
FYI the image needs to be in the correct size because the treeview will NOT scale the image.
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_______________________________________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
radialronnie wrote: FYI the image needs to be in the correct size because the treeview will NOT scale the image.
Yes it will.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Sorry bout that, never saw that before.
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_______________________________________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
A train stops at a terminus, a bus stops at a terminus, on my desk I have a terminus.
(Well, I used to anyway.)
|
|
|
|
|
radialronnie wrote: FYI the image needs to be in the correct size because the treeview will NOT scale the image.
Thanks guys for your answers but What size the correct size is?
modified on Saturday, May 24, 2008 11:23 AM
|
|
|
|
|
None in particular. What I meant was that if you would add a High resolution folder icon (4example) it would show huge in the threeview. According to the post before this one though, you can set auto scale, where a 21X21 image would show the same size as a 128X128. I don't what property this is though.
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_______________________________________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
|
sure, anyday!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_______________________________________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Hi all.
I want to know What the meaning of @ character is in Regular expression pattern?
Like this :
Regex.Replace(str , @"pattern", "");
Thanks in advanced .
|
|
|
|
|
Hi,
The @ symbol is 'nothing' to do with the actual pattern... it is placed in front of a string to tell the compiler to ignore all escape characters (backslashes: \) contained within the string.
"\n" <- newline character
@"\n" <- \n
Matthew Butler
|
|
|
|
|
Thanks Matthew.
Your answer was useful.
|
|
|
|
|
The following is a sample HTTP POST request and response
POST /Suppliers/WebServices/InsertLeads.asmx/InsertLead HTTP/1.1
Host: apps.abcsite.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
SupplierID=string&SupplierPassword=string&FirstName=string&LastName=string&EmailAddress=string&CoAppFirstName=string&CoAppLastName=string&Address=string&City=string&State=string&PostalCode=string&HomePhone=string&WorkPhone=string&WorkPhoneExt=string&CurrentEmployer=string&YearsThere=string&Income=string&BestCallTime=string&OriginalLeadDate=string&ExternalLeadID=string&IPAddress=string&ExtraFields=string
I want the below code to return me in HTML format instead of XML.
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<returnmessage xmlns="http://www.abcsite.com/">
<errorname>string
<errordescription>string
<leadid>string
<clientavailable>boolean
Here is one Instruction but I am asked to use this for C# , which I do not know :
This example assumes you have basic knowledge of how to use Visual Studio and the .NET Framework. In this example, the web reference to the ABCSite web service has already been added under a single folder called ABCSite. You would typically use this implementation when posting real time leads to our system via a form on one of your websites. This example is written in C#.
ABCSite.InsertLeads dpRealTimeWS = new ABCSite.InsertLeads();
ABCSite.returnMessage dpReturnWS = new ABCSite.returnMessage();
dpReturnWS = dpRealTimeWS.InsertLead(
Request.Form["txtSupplierID"],Request.Form["txtSupplierPassword"], Request.Form["txtFirstName"], Request.Form["txtLastName"],
Request.Form["txtCoAppFirstName"], Request.Form["txtCoAppLastName"],
Request.Form["txtCity"], Request.Form["txtState"], Request.Form["txtPostalCode"], Request.Form["txtHomePhone"], Request.Form["txtWorkPhone"], Request.Form["txtWorkPhoneExt"], Request.Form["txtBestCallTime"], Request.Form["txtEmailAddress"], Request.Form["txtOriginalLeadDate"],Request.Form["txtExternalLeadID"], Request.Form["txtIPAddress"], Request.Form["txtExtraFields"]);
lblWSResponse.Text = dpReturnWS.ErrorName + " " + dpReturnWS.ErrorDescription;
|
|
|
|
|
You need to ask this in the asp.net forum. I cannot stress highly enough the urgency of this advice.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi everyone
Does normal (not passive) FTP download needs threading? I mean when I make a data socket (bind, listen and then accept it) socket.accept is blocking and my program blocks and does no work anymore. should i seprate the socket.accept & the download process in two threads????
modified on Monday, May 19, 2008 4:57 PM
|
|
|
|
|
yes, you should.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
The simple answer is no it does not need threading however as Christian pointed out, you should implement it.
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
|
sorry i can't understand what u mean, i should implement what?
|
|
|
|
|
You don't have to implement threading however if you do then you won't lock up your program while it downloads stuff. By implementing threading the program is more responsive and can deal with more things at once.
However if this is for a quick script or something then there's probably no need to overcomplicate matters with having to deal with threading.
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
|
Actually this is my code for downloading file from ftp server
public void download(string remFileName, string locFileName, Boolean resume)
{
if (!logined)
{
login();
}
setBinaryMode(true);
Console.WriteLine("Downloading file " + remFileName + " from " + remoteHost + "/" + remotePath);
ftpLog("Downloading file " + remFileName + " from " + remoteHost + "/" + remotePath);
if (locFileName.Equals(""))
{
locFileName = remFileName;
}
if (!File.Exists(locFileName))
{
Stream st = File.Create(locFileName);
st.Close();
}
FileStream output = new FileStream(locFileName, FileMode.Open);
createDataSocket(true);
if (dataSocket != null)
{
throw new Exception();
}
dataSocket = listeningSocket.Accept();
listeningSocket.Close();
listeningSocket = null;
if (dataSocket == null)
{
throw new Exception("Winsock error: " +
Convert.ToString(System.Runtime.InteropServices.Marshal.GetLastWin32Error()));
}
sendCommand("RETR " + remFileName);
if (!(retValue == 150 || retValue == 125))
{
throw new IOException(reply.Substring(4));
}
while (true)
{
bytes = dataSocket.Receive(buffer, buffer.Length, 0);
output.Write(buffer, 0, bytes);
if (bytes <= 0)
{
break;
}
}
output.Close();
if (dataSocket.Connected)
{
dataSocket.Close();
}
Console.WriteLine("");
readReply();
if (!(retValue == 226 || retValue == 250))
{
throw new IOException(reply.Substring(4));
}
}
and in the line signed with //########## the execution stops( or blocks, whatever). What can I do except implementation of threading?
|
|
|
|
|
Can you use a TCP viewing utility thing to see the traffic that's going backwards and forwards. My thoughts are that you're not actually making the connection successfully to the FTP server and it's sitting there indefinitely waiting for a connection.
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
|
Hi,
Just a couple of immediately obvious problems:
1. The Accept call will block until someone (the server) calls back. So... you should either use a separate thread (as suggested) or don't call Accept until you've sent the command to the server.
2. I can't see that you're sending the server the port number you're listening on (unless you've done this in sendCommand(), of course). If you don't, how can it call back? This doesn't apply to passive FTP, of course, but in passive FTP you don't listen - you connect.
In any case, unless you're just practicing on how to use sockets - if you really need an FTP client and don't want to do all the details yourself: look at System.Net.WebClient and System.Net.FtpWebRequest in the framework documentation. Either of them will probably do what you want - and a lot easier. Pick the one you like...
--
Peter
|
|
|
|
|
I am working on a program to display pupil essay homework data.Making the program define class pupil and class homework. Program to display hardcoded data for homework such as 150words, word friend in text etc. User of program to be able to enter keywords to be checked for and be able to request to see such essay homework data for a pupil.
Any clues how to get on such a task ?
public class Pupil
{
private string name;
private int id;
private static int numberofPupils = 0;
public pupil(string pupilName);
{
name = pupil Name;
id = ++numberofPupils;
}
public class homework
{
private string homeworktitle
private int numofwords
private string keyword etc
|
|
|
|