|
lawrenceinba wrote: '\0'
is the above command valid for calculating end of line in while loop...
I have never seen any system where the NUL character is used as end of line. It's commonly used as end of string in systems that doesn't have a String object that keeps track of the length.
lawrenceinba wrote: if not wat should be used to EOF identification
The '\x1a' character is the EOF marker, however .NET doesn't use any EOF marker.
You should ask about what you are trying to do instead of asking about some obsolete techniques that doesn't apply to C#.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
i'll give input to a while loop....it should exit at end of string
this is what i need
the quieter u become more u hear
|
|
|
|
|
If you want to loop through the characters in a string, you can use the enumerator or the Length property:
foreach (char c in daString) {
Console.WriteLine(c);
}
for (int i = 0; i < daString.Length; i++) {
Console.WriteLine(daString[i]);
}
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
can we do row span and column span of c# datagrid.i want to split my columns to look like
name
first last
|
|
|
|
|
You can override paint event and draw manually.
|
|
|
|
|
Hi,
I'm assigning an URL to clipboard and when i paste that to Word document that becomes normal text, How can i retain that as a URL?
Thanks
|
|
|
|
|
It's a bit of a pain - basically you need to format the next in "HTML Clipboard Format" ( link[^] ) - it's the bit between StartFragment and EndFragment that actually gets pasted into Word
|
|
|
|
|
Hi,
I have Listbox(lstgroups) and listview(lstItems). say items in lisbox as Groups and in listview as Items.
Each Group should have list of items, when i add an new item to lstitems. it should assign to selected group. and If I add two items to a selected group and moved to Second goup and added items to these. Then if moved to first group the intial added Items are to displayed in Listview. is that Possible.
By using dictionary classes
Here List<object> should return lstitems
Dictionary<string, List<object>> d= new Dictionary(string, List<object>>();
d.add(lstgroups.items, new List<object>);
//error cumes here, how to assign here List<>
Thanks and regards,
Uday
|
|
|
|
|
I don't understand what the problem is :-
Dictionary<string,>> d = new Dictionary<string,>>();
List<object> list = new List<object>();
list.Add("Item1");
list.Add("Item2");
list.Add("Item3");
d.Add("ItemGroup1", list);
|
|
|
|
|
Hello All,
I want to read all mail of one folder from outlook and here is code at which line i am getting error....
Outlook.Items MailItems;
MailItems = .......
for (int i = MailItems.Count; i >= 1; i += -1)
{
Outlook.MailItem mitem;
mitem = (Outlook.MailItem)MailItems.Item(i); }
When casting getting below exception..
Tried lot from Google and other sites not getting appropriate solution.
Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook.MailItem'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063034-0000-0000-C000-000000000046}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Were you able to figure this out? I am having the smae problem on undeliverable emails that are bounced back to the inbox.
thanks
dennis
|
|
|
|
|
The below section should assist anyone attempting to use the MailItem object.
The key to this code not throwing exceptions is that the items collection may
contain more than just MailItems and therefore the following code allows you
to retrieve just the MailItems from the collection.
Outlook.Application olApp = new Outlook.Application();
Outlook.MAPIFolder inBox = (Outlook.MAPIFolder)olApp.ActiveExplorer().Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
Outlook.Items Inboxitems = inBox.Items;
foreach (Outlook.MailItem item in Inboxitems.OfType<Outlook.MailItem>())
{
InboxSize = InboxSize + item.Size;
}
Obviously once you have a handle to the individual Mailitem you can access all of it's properties.
Happy Coding
|
|
|
|
|
i want to extract attachments stored in xml in document tag on my local pc
|
|
|
|
|
Reetu Singh wrote: extract attachments stored in xml
How XML file can store other documents? Your question is not clear. Please explain it clearly.
|
|
|
|
|
i m working on a tool which converts notes to .net
we convert the .nsf files to .xml
these nsf contains attachment which comes under document tag in xml
now i wamt to extract it to my local system
|
|
|
|
|
Hi,
if you know the tags in the xml, you can use the classes in the System.Xml namespace to browse to these nodes and extract their content. (Are the documents encoded e.g. base64?). Then you could use a FileStream to write the content to your local system.
Regards
Sebastian
|
|
|
|
|
thanks for the reply
i'll try using filestream.
|
|
|
|
|
hi, i tried with filestream
but i cant decode it.
the data is coming in encoded formatt.
i m storing all the data using bytearray and for encoding using
system.text.encoding but it isnt working.
|
|
|
|
|
What is the encoding of the data? Is it encoded base64 or just plain UTF-8? Could you post a snippet of the xml document?
|
|
|
|
|
hi,
i got the solution it was just a line
Convert.FromBase64String(string)
|
|
|
|
|
So it was base64 encoded...
|
|
|
|
|
hello
I ran into a problem with NHibernate - "LastUpdate" field of my class defaults to null but when inserted into NHibernate I got error:
<br />
+ [System.Data.SqlTypes.SqlTypeException] {"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."} System.Data.SqlTypes.SqlTypeException<br />
I want to avoid hardcoding "NULL" to 1JAN1753 - any alternatives? Thanks
dev
|
|
|
|
|
|
Did you use a nullable DateTime (i.e. DateTime?) as the type for your field? If not, the default value for the field will not actually be null. It will be a value outside of the 1753-01-01 to 9999-12-31 range.
|
|
|
|
|
Thanks - is there a good solution to this other than hardcoding a date = 1753 for uninit default?
dev
|
|
|
|