|
Hi David,
is it possible that something is wrong with "LogList.Items"?
did you try this?
string tempResult = RdStrm.ReadLine();
Sebastian
|
|
|
|
|
David37 wrote:
LogList.Items.Add(RdStrm.ReadLine());
The problem is that streams return null when the end is reached.
What you need to do is put the value of RdStrm.ReadLine() in a temporary value, then only add the value if it isn't null.
James
|
|
|
|
|
Thanks a lot guys...
But ... James, how come i have null all the time ...
Then, if I am commenting those lines out ...I am getting next error :
"Unable to write data to the transport connection" ... so when i am tracing I am getting that even net stream gets null ... No stream ... like something is definitely wrong ... or i don't see something..
Any suggestions?
Maybe my problem is SMTP Server itself :
TcpClient SmtpServ = new TcpClient(ServSMTP.Text,25); ????
Code :
NetworkStream NetStrm = SmtpServ.GetStream();
StreamReader RdStrm= new StreamReader(SmtpServ.GetStream());
tempResult = RdStrm.ReadLine();
if (tempResult != null)
{
LogList.Items.Add(tempResult);
}
// say hello to server and send response into log report
Data = "HELLO server " + CRLF;
szData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray());
NetStrm.Write(szData,0,szData.Length);
//LogList.Items.Add(RdStrm.ReadLine());
|
|
|
|
|
Hello all.
I don't know C#,(and english too!), I'm starting with .net.
I'd like to know if in C# is possible do these 2 things:
Read who(user or groups) have access permission to a specific file or folder
and how(read,write,execute).
Second, is possible access other usefull information stored in indexing server about a file like the Author,Comments,Version,Company ecc. ecc.
I have searched a class to do this in .NET Framework without success.
I don't need the solution but at least a little help how to start.
Thanks, thanks in advance!!!
Sergio Bertini
|
|
|
|
|
serberwww wrote:
Read who(user or groups) have access permission to a specific file or folder
and how(read,write,execute).
Second, is possible access other usefull information stored in indexing server about a file like the Author,Comments,Version,Company ecc. ecc.
I think for this purpose you have to use API.
For getting file attribute you can use FileAttributes class.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
API? with c# and .NET is possible?
mmm, with FileAttributes I can access all these properties:
Archive = 0x00000020,
Compressed = 0x00000800,
Device = 0x00000040,
Directory = 0x00000010,
Encrypted = 0x00004000,
Hidden = 0x00000002,
Normal = 0x00000080,
NotContentIndexed = 0x00002000,
Offline = 0x00001000,
ReadOnly = 0x00000001,
ReparsePoint = 0x00000400,
SparseFile = 0x00000200,
System = 0x00000004,
Temporary = 0x00000100,
I'd like extract other usefull info in the file that
are also indexed by the index server.
How?
Sergio Bertini
|
|
|
|
|
serberwww wrote:
API? with c# and .NET is possible?
OF course,but not very easy and I don't like it. For an example check this:
DriveComboBox
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
If you are talking about an a computer on a network using Active Directory, then the System.EnterpriseServices namespace of classes might help you.
Knowing next to nothing about the Active Directory model; thats all I can offer.
HTH,
James
|
|
|
|
|
No, I want to read them on a local computer.
Or, How can I know if a User/Group have
access to a file or folder?
Ciao
Sergio Bertini
|
|
|
|
|
Is it possible to run C# apps on windows 98? When I try it complains about not being able to find the MSCOREE dll, but I cant install the SDK to get it there, can I?
Thanks
|
|
|
|
|
Anonymous,
I have executed C# applications on Win98 with the runtime installed. Did you download the runtime or install it from the MSDN?
Rich
|
|
|
|
|
You need to atleast install the .NET resdistributable. You can't install SDK to development but you can run .NET apps
|
|
|
|
|
All,
For a while, I have searched for information creating and using "grab handles." At this point, the only thing I have found is some weak information on the MSDN on DrawGrabHandle. Does anyone know of a good resource for this?
Thanks In Advance,
Rich
|
|
|
|
|
I got the following code:
using System;
namespace AbelSoft.LudoGame
{
///
///
///
public class Piece : System.Drawing.Image
{
public Piece()
{
}
}
}
and this is the error i got:
C:\Documents and Settings\Franck-Alain\My Documents\Visual Studio Projects\LudoGame\Piece.cs(10): 'System.Drawing.Image.Image()' is inaccessible due to its protection level
|
|
|
|
|
franck_alain wrote:
'System.Drawing.Image.Image()' is inaccessible due to its protection level
This looks like it is a sealed class, hence you would not be able to derive your own class from it.
If you need a graphics object, you can override the OnPaint method.
Nick Parker
|
|
|
|
|
Why is it that when I right click on a tree node and my context menu pops up, the item that is returned by the treeView1.SelectedNode property is not the item that was right-clicked on, but whatever tree node happend to be selected before the right click?
i.e.
Folders
_________
|FolderA| <-- Currently selected tree node
---------
FolderB
FolderC <-- Right click here
treeView1.SelectedNode returns FolderA, not FolderC, even thought the selected node highlighting box temporarily moved to FolderC.
Scratching my head...
Thanks,
Rick
|
|
|
|
|
Thats just the way the TreeView works. Crappy answer, but if you look at the behavior in Windows Explorer it is the same.
I believe the justification is that selecting the node is so you can tell which node was right-clicked on. Right clicking should not select an item; you are merely requesting a menu to popup.
James
|
|
|
|
|
I have to disagree, at least w/respect to how Windows Explorer works. If I left click Folder "A" in explorer to select it, then right click on folder "B" and select "properties" I get a property page for folder "B", not folder "A".
This is the behaviour on Windows 2000.
If I were programming with pure Win32, I would just do a hit-test on the item under the mouse cursor, but I can't find an analog in C#.NET.
Thanks,
Rick
|
|
|
|
|
rhoward wrote:
If I left click Folder "A" in explorer to select it, then right click on folder "B" and select "properties" I get a property page for folder "B", not folder "A".
Correct, but when you close the property page the folder "B" *isn't* selected, folder "A" is. Sorry I didn't make that clear in my posting.
James
|
|
|
|
|
Sorry for the misunderstanding. You are definitely correct about "A" still being selected.
The point I was making is that Explorer displays properties for "B", not "A", which is what I was trying to achieve.
Thanks,
Rick
|
|
|
|
|
As James said, that is by design. The way to work around the design is like so:
treeView1.SelectedNode = treeView1.GetNodeAt(e.X, e.Y);
Call that before you pop-up the context menu
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
Many thanks, David.
I was able to use GetNodeAt() in the MouseUp event for the tree to reset the selected node to the proper item.
Thanks again,
Rick
|
|
|
|
|
I have component object that handles controls in a typesafe array like so
<br />
[Designer(typeof(ComponentGen.Repository.CompGenDesigner))]<br />
public class CompGen : System.ComponentModel.Component<br />
{<br />
private ComponentGen.Collections.CtrlCollection c_ctrls = null;<br />
...<br />
}<br />
when the controls are added to the component using the design wizard, the form's Initialize() event adds this code:
<br />
this.compGen1.RepositoryControls.AddRange(new System.Windows.Forms.Control[] { this.MASTER, this.CATEGORY, this.TEST_CODE});<br />
...<br />
<br />
this.Controls.AddRange(new System.Windows.Forms.Control[] { this.MASTER, this.CATEGORY, this.TEST_CODE});<br />
...<br />
*MASTER, CATEGORY, and TEST_CODE are the generated controls (System...Control wrapped controls)
The problem
when the controls are first drawn, they show up perfectly drawn. when the form is closed and re-opened, the controls are not redrawn (transparent) but still exist and work perfectly when run.
The problem goes away when the controls are not added to the repository in that Initialize code.
Questions, Leads
-Do i have to override a paint or something in either the controls designer or the repository component?
-Why is simply adding references to the components in a collection stopping the form from repainting the controls?
|
|
|
|
|
This is a good question and im surprized ive got nothing so far. but right clicking on a tree gets four replies in an hour! come now. where have all the gurus gone?
|
|
|
|
|
poodull wrote:
Do i have to override a paint or something in either the controls designer or the repository component?
Are MASTER, CATEGORY, and TEST_CODE controls of your own design or ones provided elsewhere?
Now my second question; what do you mean by a repository component? To me that would be a component which stores other components for later use; is that correct?
poodull wrote:
Why is simply adding references to the components in a collection stopping the form from repainting the controls?
Ensure that the Parent property is set to the proper entity, ie if the controls should be on the form Form1, Parent should be a reference to Form1.
James
|
|
|
|