|
How you create a file, is up to you. What is an eml file ? I have no idea.
You need to know how to send a file via email ? There's tons of articles online that cover this.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Christian Graus wrote: What is an eml file ? I have no idea
Just looked it up in Thunderbird by saving an e-mail in this format. It's basically just the mail header as received from the mail server (from, to, subject, mime, content-type, return-path) and the message body.
I don't see how this can be used to send e-mail.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi, i got a hashtable within a hashtable. How do i retrive the property from the inner hashtable
I got this orderTable which store a Order object.
Inside my Order object, i have a Hashtable itemList as a attributes. The itemList will store a product object which have the property ModelNumber
foreach (Order order in orderTable.Values)
{
if (order.ItemList.ContainsKey(Convert.ToString(p.ModelNumber)))
{
uint modelNum = ((Product)order.ItemList[p.ModelNumber]).ModelNumber;
string cellValue = Convert.ToString(p.ModelNumber);
if (cellValue == Convert.ToString(modelNum))
{
dataGridProduct.Rows[currentRow].Cells["colSelect"].Value = true;
}
}
}
this is what i do, but i get
Object reference not set to an instance of an object.
on this line
uint modelNum = ((Product)order.ItemList[p.ModelNumber]).ModelNumber;
|
|
|
|
|
benjamin yap wrote: order.ItemList[p.ModelNumber]
This, by definition, returns a hashtable, not a Product. That's what you said, right ? That returns a hash table, so you need to pull the value out of that hash table. I am surprised you don't get an invalid cast exception.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
i cast a (Product) infront already and i just do a .ModelNumber
issint this pulling out the value? i tried many ways but cant seems to work. Probably you could help me with it?
|
|
|
|
|
The other response makes sense. I think what you said is wrong, I don't think you have a hashtable of hashtables. I think you're using a bad key, or a key to a value that was stored as null.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Christian Graus wrote: This, by definition, returns a hashtable, not a Product.
I guess ItemList is already the inner hashtable which will, when accessing the indexer, return a Product
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I guess so, I was just looking for the code that does what he asked about - accesses an object that is two hashes deep.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
benjamin yap wrote: this is what i do, but i get
Object reference not set to an instance of an object.
on this line
This may have several reasons:
- order is null
- the returned Product may be null: You are checking ContainsKey with a string (Convert.ToString(p.ModelNumber)), but pass some other data type to the hashtable key (p.ModelNumber)
Try this:
foreach (Order order in orderTable.Values)
{
string modelNumberStr = Convert.ToString(p.ModelNumber);
if (order != null && order.ItemList.ContainsKey(modelNumberStr))
{
uint modelNum = ((Product)order.ItemList[modelNumberStr]).ModelNumber;
string cellValue = modelNumberStr;
if (cellValue == Convert.ToString(modelNum))
{
dataGridProduct.Rows[currentRow].Cells["colSelect"].Value = true;
}
}
}
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
thanks! i got it working! thanks to you both!
|
|
|
|
|
Apologies if this is not in the correct forum, but hopefully someone can help with the below issue:
I have a C# Windows Service (.Net 2.0) that is to be installed on a collection of web servers in the DMZ. The Windows Service implements a FileSystemWatcher to check for changes to a set of specific CSV files held on a network share, and will copy locally any updated files before importing these to a local SQL database.
The distribution server that will hold the updated CSV files is also in the DMZ.
The problem:
How can I set up the Windows Service / distribution server so that the service can access the network share securely? It seems that no matter how I set the service up i.e. running as LocalSystem, LocalService, NetworkService or a specific user account (can only be a local account as no access to AD in the DMZ) I get System.UnauthorisedAccessException's occuring when attempting to set up the FileSystemWatcher.
Any help would be greatly appreciated.
Clean code is the key to happiness.
|
|
|
|
|
I created one page which contain one timer which will execute some function after every 5 min and send one mail to my id. Now the problem is i m not able to stop that one after every 5 min i receive mails. I close that page so it not execute but still it is running. How to stop that timer.
|
|
|
|
|
timer.Stop() or timer.Enabled=false.
|
|
|
|
|
Please don't double post. This is an ASP.NET question, you asked it there. The person who answered you assumed you knew where to post and gave you a winforms answer.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Turn off the computer in question
-or-
Configure your email spam filter to block all messages from that server.
"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
|
|
|
|
|
posted 30 June 2008 12:35
--------------------------------------------------------------------------------
I would like to create a GUI that allows a user to view 2 database tables and then drag and drop mappings - mapping the columns from database 1 to the columns in database 2. Does anyone know of an open source project/3rd party dll that does something similar, or any relevant tutorials?
Something similar to this:
http://www.schemaware.com/mapper_db.htm[^]
Thanks for any help.
|
|
|
|
|
Hi everyone
I want to redirect from a .aspx page to another page while the page has been sent to client so by using Response.Redirect() method, I get an error saying "Response is not available in this context."
I also used Server.Transfer() method, this one created an error saying "error in executing child node"
Does anyone know what I may use instead of Response.Redirect() and Server.Transfer()?
|
|
|
|
|
If Reponse.Redirect does not work, something is very broken on your web page. I suggest you ask in the ASP.NET forum.
|
|
|
|
|
I think you try to call Redirectmethod outer than pageclass.
Use :
using System.Web.HttpContext;
.
.
.
.
HttpContext.Current.Response.Redirect(url);
I hope it helps you
ITS7
|
|
|
|
|
what is the iis pick up service?
How to send e-mail from desktop application in .net using iis pick up service?
|
|
|
|
|
Hi All,
I have a datatable and i want to get the first and second characters of a column of each row of my datatable:
foreach (DataRow dr in dt.Rows)
{
string str = dr[5].ToString();
char first = str[0];
char second = str[1];
}
Bud i m getting a error: Index was outside the bounds of the array
on the 5e line : char second = str[1];
can anyone tell me why and what is the solution?
Thanx
|
|
|
|
|
KamarBand wrote: string str = dr[5].ToString();
You should use the value inside the DataColumn, not the DataColumn itself (let me guess the column name is only 1 character).
|
|
|
|
|
Hi Leppie, thanx fory reply, i found the problem, one of the rows had a empty string, that's why i got the error.
|
|
|
|
|
KamarBand wrote: Bud i m getting a error: Index was outside the bounds of the array
on the 5e line : char second = str[1];
can anyone tell me why and what is the solution?
Yeah, you don't do any bounds checking on the string. In this case it's exactly one character long. If the string is empty, then it'll also crash in char first = str[0];
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi everybody
I hope I ask my question in the right place.
I want to access to source code of a WEBPAGE and change it.
For this, use mshtml.HTMLDocument2.
Usually I write source code with a StreameReader on Object IHTMLDocumetn2.
The output of StreamReader is perfect.
But after writing the output on IHTMLDocument2 something strange happens.
some quotation marks and backslashes disappear and the header changes.
Codes are as below:
string Content = MyStreamReader.ReadToEnd();
HTMLDocument MyDoc = new HTMLDocumentClass();
IHTMLDocument2 DocToUse = (IHTMLDocument2)MyDoc;
DocToUse.write(Content);
DocToUse.close();
Here the content and DocToUse.body.parentElement.outerHTML.ToString() should be excatly
the same but they are not. For better understanding please find the 2 screenshots.
Output of StreamReader: Click hier
Output of DocToUse.body.parentElement.outerHTML.ToString(): Click hier
Your kind reply will be much appripricate.
Best Regards.
ITS7
|
|
|
|