|
Lucy_H85 wrote: Appologies if I sounded rude but I was not being rude at all.
It's ok Please right back if you are still experiencing problems.
|
|
|
|
|
I'm working in C#.Net 2005.
I want to know that is there any solution to set File System Watcher on multi folders???
I'm waiting for quick reply...
Thanx in advance.
Rakesh
|
|
|
|
|
You can include have filesystemwatcher that looks at a directory and its subdirectories. If you need for different directories, then you will need several filesystemwatchers.
|
|
|
|
|
Thankx for your reply.
Is there any other way for multi folder watcher except add as many fileSystemWatcher as many folders that I want set watcher???
Rakesh
|
|
|
|
|
|
Thankx.
But if it is possible than please inform me.
Rakesh
|
|
|
|
|
I am developing a Outlook Shared add-in application using C#.net vs2005.
Here I save some user settings to the user.config file.
The settings are saved.
It is saving in the folder:
C:\Documents and Settings\<user name="">\Local Settings\Application Data\Microsoft_Corporation\<application name="">\10.0.2576
But I want to Store the user.config file in the Location that I Specify.
How can I do this?
I am trying to write a Custom Setting class but even I can’t do this!!!!!
Can this be done?
Is there any link tutor or any resource for this?
Awaiting reply,
Thanks in advance,
SrinivasanPrabakaran
|
|
|
|
|
|
I've made an inherited ListView control with a customized ColumnHeader Type.
I've overwritten the Columns property with a collection of my custom
ColumnHeader items. Now I would like to implement serialization so that
columns are persisted from designtime to runtime. But I cannot get it to
work.
I think it's because I don't know how to implement the type converter
correctly. Here's my suggestion for the type converter. Sample code for the
ListView, ColumnHeaderCollection and ColumnHeaderItem is supplied below. Can
anybody tell me what's wrong?
I've got a small test project (C# 2005) that I've stripped of everything but
the important part (the collection) - I cannot get the serialization to
work. I add columns at designtime, but no matter what, the columns are not
persisted to runtime. If anybody has got the time to help me, I can mail the
test project. I would REALLY appreciate any help I can get.
Cheers, Johnny J.
public class MyListViewColumnConverter : TypeConverter
{
public override bool CanConvertTo
(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(InstanceDescriptor))
{
return true;
}
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo
culture, object value, Type destinationType)
{
if (destinationType == typeof(InstanceDescriptor) && value is
MyListViewColumn)
{
MyListViewColumnitem = (MyListViewColumn)value;
ConstructorInfo ci = typeof(MyListViewColumn).GetConstructor(new Type[]
{ });
if (ci != null)
{
return new InstanceDescriptor(ci, null, false);
}
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
**********************************************************
Listview, ColumnheaderCollection, ColumnHeaderItem code:
namespace MyListView
{
public class MyListView : ListView
{
private MyColumnHeaderCollection myListViewColumnHeaders = null;
public MyListView()
{
myListViewColumnHeaders = new MyColumnHeaderCollection(this);
//Other Code
}
public MyListView(IContainer container)
{
myListViewColumnHeaders = new MyColumnHeaderCollection(this);
container.Add(this);
//Other Code
}
[Localizable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Editor("System.Windows.Forms.Design.ColumnHeaderCollectionEditor,
System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
[MergableProperty(false)]
public new MyColumnHeaderCollection Columns
{
get { return myListViewColumnHeaders; }
}
//Other Code
}
[DesignTimeVisible(false)]
public class MyColumnHeaderCollection : ListView.ColumnHeaderCollection
{
private SortedList columnList = new SortedList();
public new MyListViewColumn this[int index]
{
get
{ return (MyListViewColumn)columnList.GetByIndex(index); }
}
public override ColumnHeader Add(string str, int width, HorizontalAlignment
textAlign)
{
MyListViewColumn column = new MyListViewColumn(str, width, textAlign);
this.Add(column);
return column;
}
public override int Add(ColumnHeader column)
{
return this.Add(new MyListViewColumn(column));
}
public override void AddRange(ColumnHeader[] values)
{
for (int index = 0; index < values.Length; index++)
{
this.Add(new MyListViewColumn(values[index]));
}
}
public int Add(MyListViewColumn column)
{
int retValue = base.Add(column);
columnList.Add(column.ColumnID, column);
return retValue;
}
public new void Remove(ColumnHeader column)
{
base.Remove(column);
columnList.Remove(((MyListViewColumn)column).ColumnID);
}
public new void RemoveAt(int index)
{
ColumnHeader column = this[index];
this.Remove(column);
}
public new void Clear()
{
base.Clear();
columnList.Clear();
}
}
[DesignTimeVisible(false)]
[TypeConverter(typeof(MyListViewColumnConverter))]
public class MyListViewColumn : ColumnHeader
{
private int m_ColumnID = 0;
private static int autoColumnID = 0;
public MyListViewColumn()
{
Initialize("", 60, HorizontalAlignment.Left);
}
public MyListViewColumn(string str, int width, HorizontalAlignment
textAlign)
{
Initialize(str, width, textAlign);
}
public MyListViewColumn(ColumnHeader column)
{
Initialize(column.Text, column.Width, column.TextAlign);
}
private void Initialize(string str, int width, HorizontalAlignment
textAlign)
{
base.Text = str;
base.Width = width;
base.TextAlign = textAlign;
m_ColumnID = autoColumnID++;
}
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public int ColumnID
{
get { return m_ColumnID; }
}
}
}
|
|
|
|
|
i have a .net(C# + asp.net) web application that needs to show a set of log files on the browser once the user is logged in. The user should be able to download the files by clicking or right click->save as.
any ideas or samples will be thankful.
|
|
|
|
|
Here's[^] a sample that shows you how to do this.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
thanks for the reply.
I think the sample you mentioned will directly downlaod all the files without any selection.
i want the user to click a file and then download.
|
|
|
|
|
thanks for the reply.
I think the sample you mentioned will directly downlaod all the files without any selection.
i want the user to click a file and then download.
i mean i want the files names as a kind of links on the web page.
|
|
|
|
|
To do this, you need to build the list of links yourself, and dynamically attach an event handler which handles it in the same way that the button click does in the article.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I want to insert 2 rows into my spreadsheet but I have a dataset that is inserting values into the spreadsheet and I want to insert the rows after that values from my dataset.please help thanks.
|
|
|
|
|
how to loop the label or textid in C#.net
as per vb
textboxname.text=cmd.executescalar()
but it,s not working in c#.net
anyone tell me the suggestion now
lucky
|
|
|
|
|
Lucky Sheikh wrote: how to loop the label or textid in C#.net
as per vb
textboxname.text=cmd.executescalar()
but it,s not working in c#.net
anyone tell me the suggestion now
What do you mean "loop the label or textid"?
The code you have written puts the value of the first column of the first row in the Text property of the text box. It won't loop over anything.
|
|
|
|
|
textboxname.text=cmd.executescalar()
ExecuteScalar returns object.
You assigned this object to var string so that u r getting error here
try this code
textboxname.text=cmd.executescalar().ToString();
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Imran Khan Pathan wrote: textboxname.text=cmd.executescalar().ToString();
And if the result set contains zero rows this will fail also.
|
|
|
|
|
Hi All...
I work for a software development company which writes Telephony solutions.. All of our backend components are written in C++ but the problem I am finding is it is taking us to long to get products to market and am looking for a quicker means of writting these applications.. I have been researching and toying with the idea of moving some of our newer products to C# to try and improve stability and simplicity in our applications. The only thing I am unsure about is the performance aspect and if C# can do just as much as C++ can. We use Threads, Handles and pointer list's extensivly. These applications are real-time applications and need to perform task's quickly and efficiently without delay. Maybe I am asking to much of having the best of both worlds but any advice would be appreciated..
|
|
|
|
|
A common misconception is that C# cannot work with pointers. This is not true. While it is not recommended to work directly with pointers, you can do it by marking regions of code as unsafe, so you could move highly intensive pointer based code into these areas. I would question though, whether or not this is a route you would want to go down when you can mix C++ and C# projects in the same solution.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi all,
I have a xml file of the following format.
<xml version="1.0" encoding="UTF-8">
<MainCategory>
<category1>
<title>First Title</title>
<Description>Some description</Description>
</category1>
<category2>
<title>Second Title</title>
<Description>Some description about the second category</Description>
</category2>
</<MainCategory>
</xml>
the data from the xml file is stored in a datatable and set as a datasource to datagridview.
now when a new entry is added to the top of the xml file, say like this,
<xml version="1.0" encoding="UTF-8">
<MainCategory>
<NewCategory>
<title>New Title</title>
<Description>description about new category</Description>
</NewCategory>
<category1>
<title>First Title</title>
<Description>Some description</Description>
</category1>
<category2>
<title>Second Title</title>
<Description>Some description about the second category</Description>
</category2>
</<MainCategory>
</xml>
how can i check the xml file for new changes and display the values for the new categories alone?
this xml file is not stored in the local machine. how can i accomplish the same without storing the xml file locally?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
how to insert,update and delete records in a SQL Express 2005 database using typed dataset in c#.net 2005
himanshu p.taunk
|
|
|
|
|
Hello. In Visual Studio 2005, there is a Stop method that you can call from any method to stop the service. That is useful in case something went wrong.
I see that in Visual Studio 2003, that method doesn't exist. How can I then stop the service from code?
Regards,
Diego F.
|
|
|
|
|
Hi Diego,
Although I'm not 100% sure of how to do it, hopefully this puts you in the right direction. A service can only be started or stoped by the OS (for what I understand anyways...). So to stop it you either have to use the Services management snap-in in Win2k / XP etc or the NET command from the command prompt. Stopping it from your code is probably going to be easier from the latter...
NET Stop <servicename>
Hope this helps!
Having said all the above... have a look see here... http://support.microsoft.com/kb/245230[^]
TimmyFox
|
|
|
|