|
kknepple wrote: Can anyone expound on the incoming stream and how to use this properly?
led mike wrote: Try using the Documentation
Stop making me repeat myself
led mike
|
|
|
|
|
I am sorry to have inconvenienced you but I was looking for help and have been reading the documentation and don't understand it ok? I will continue to read the documentation and I hope I find the answer. I believe these forums are here to help someone who has a question. I do understnad that there is a tendency for some laziness and people are looking to just have other people to do the work for them but I am having trouble understanding this. so if this is not the forum to get help please let me know. I mean do you go to every post and say read the documentation?
yes, you are a better programmer then me.
yes, you have been doing this longer than me.
yes, I do not know where to look.
yes, I came here for help.
is there a programmer out there that would shed some light on the subject? Like what do you need to include to read the data into the MemoryStream and what you need to read the data back out even you led Mike was a beginner at some point and came here for help before you became an MVP.
Thank you for your help!
|
|
|
|
|
kknepple wrote: and have been reading the documentation and don't understand it ok?
yep that's fine. Post the part(s) you don't understand ( and the URL to the source ) and ask specific questions. Folks here will gladly help if you do that.
kknepple wrote: Like what do you need to include to read the data into the MemoryStream
You don't have to, it's already in a stream in memory as part of the FileUpload object. Read the documentation.
led mike
|
|
|
|
|
led mike wrote: Read the documentation.
Wow. Groundhog post.
"Rise and shine campers. It's cold out there."
|
|
|
|
|
I would re-arrange this code a bit.
mm = new MailMessage (this.txtEmail.Text, "email@email.com");
mm.IsBodyHtml = false;
mm.Subject = string.Format("Design - {0}", this.txtPatternName.Text);
mm.Body = sbTemplate.ToString();
if (this.fiupDesign.HasFile)
{
string fileName = Path.GetFileName(this.fiupDesign.FileName);
mm.Attachments.Add(new Attachment(this.fiupDesign.FileContent,fileName));
}
The FileContent property returns a stream (the uploaded file) and the Attachment class has a constructor which takes a stream and the filename to use. This negates ever having to save the file to disk and running into the locking issue.
|
|
|
|
|
Hi guys
I need to write an application in C # that it will auto run when window start up. Need some info and resource on how about creating in? Any example code and sample will be deeply appreciated
Thanks A million
KaKaShi HaTaKe
|
|
|
|
|
You can run pretty much any application at Windows startup by putting a shortcut to the application's executable file in Start Menu - Programs - Startup. You have to check for localization issues (in my Spanish Windows, it's Inicio instead of Startup.)
Environment.GetFolderPath[^] with SpecialFolder.Startup[^] can get you the path to the Startup program group.
I hope this helps!
|
|
|
|
|
also in my application i also need to create an option for user to choose whether they want the option to run on start up... is that any sample code or material i can read about?
KaKaShi HaTaKe
|
|
|
|
|
Depending on your user's choice you should create or delete the shortcut in the location you get with GetFolderPath . I don't have sample code but a Google search on "creating shortcuts C#" should return what you want (as a matter of fact, the first result is a CP article that does exactly what you want.)
|
|
|
|
|
|
Hello,
I am using ReportViewer to generate report. I want my Header to be dislayed in a SubReport.
I am always getting error "SubReport could not be shown".
I am having a class ReportHeader.cs with some properties(UserName, UserDetail etc.). I want this class contents to be displayed in SubReport.
Please tell me step by step, what all i need to do ?
I have gone through so many helps available on net but i am not able to get rid of the error message.
Thanks
Gajesh
|
|
|
|
|
|
setting Format to Custom has worked for me in the past. In fact, I just checked on VS 2k5. If you feel you must then you can set CustomFormat to MM/d/yyyy h:m . Either way, it shouldn't throw any exceptions.
If you're doing this, check the events for the instance of the control to ascertain just where your problem is occurring.
-JC
|
|
|
|
|
THANKS
Have Fun
Never forget it
|
|
|
|
|
Hey all,
The query goes like this...
While browsing the internet on the web browser component,any pop-ups are by default opened on the IE.Is there any way to supress this kind of event and let my own browser open the pop-up?
Thanks in advance....
|
|
|
|
|
Aditya Baraya wrote: Is there any way to supress this kind of event and let my own browser open the pop-up?
It's not your own browser. If it was your code would be parsing the HTML and script and executing the script so yes you could do it. Since it's not "your own browser" then the answer is in the documentation for the browser you are using.
led mike
|
|
|
|
|
There must be some way to do this....
Are you really sure theres no other way to accomplish such a task????
|
|
|
|
|
WOW. Ok that was to a reply from the guy below and he deleted it so it wound up going to you, maybe, if you got it. Anyway.
Aditya Baraya wrote: Are you really sure theres no other way to accomplish such a task????
Not sure what you mean. If there is a way you will have to find it by reading the documentation for the browser control and all it's interfaces, that's all I said in my post.
led mike
|
|
|
|
|
Alrite,but I sadly havent been able to figure out where such a property is exposed....
So if you could tell me about it,I ll be really glad n grateful....
Thanks in Advance.....
|
|
|
|
|
Aditya Baraya wrote: Alrite,but I sadly havent been able to figure out where such a property is exposed
Did you check the article on MSDN about using the popup blocker interfaces?
led mike
|
|
|
|
|
I have declared a Hashtable.
The "Value" field of the hashtable refers to an ArrayList.
The Array List contains a list of objects.
Now how can I refer to a particular object in the arraylist referring to its respective "key" from the hashtable?
To make it clear I'm embedding the code here.
<br />
ArrayList errorlist = new ArrayList();<br />
Hashtable errorstable = new Hashtable();<br />
<br />
error = new Errorcodes(tokens[3].ToString(), tokens[4].ToString());<br />
errorlist.Add(error);<br />
errorstable.Add(tokens[2].ToString(), errorlist);<br />
<br />
<br />
foreach (DictionaryEntry de in errorstable)<br />
{<br />
if (de.Key.ToString() == fetchcodes[4].ToString())<br />
{<br />
string evalue =
SW.WriteLine("\t\t\t" + "public const int ");<br />
break;<br />
}<br />
}<br />
</objectvalue>
|
|
|
|
|
Ravi Mahavrathayajula wrote: Now how can I refer to a particular object in the arraylist referring to its respective "key" from the hashtable?
Have you looked at the documentation for the Hashtable class? If you can't figure it out by reading the documentation then buy a beginners book or take a course at a university.
led mike
|
|
|
|
|
Ravi Mahavrathayajula,
What are you trying to do?, eg: whats the problem your trying to solve. Just because its looks a bit complicated for something as simple as storing a list of "Errorcodes".
Regards,
Gareth.
|
|
|
|
|
Thanks for looking into the problem Gareth.
ErrorCodes is a class as shown below.
<br />
class Errorcodes<br />
{<br />
public string Errorvalue;<br />
public string Errorcomments;<br />
<br />
public Errorcodes(string Errorvalue, string Errorcomments)<br />
{<br />
this.Errorvalue = Errorvalue;<br />
this.Errorcomments = Errorcomments;<br />
}<br />
}<br />
Now I actually need to read 3 fields into a loop, but as hashtables cannot process more than 2, I've read one as key and stored the other 2 fields as objects of the class error codes in a hashtable. Now as I retrieve a "Key" from the hashtable, its respective "Value" field must also be retrieved. But since the Value field in this case is actually an object of ArrayList, I was confused how could I retrieve a particular object that I needed.
|
|
|
|
|
Ravi Mahavrathayajula wrote: I was confused how could I retrieve a particular object that I needed.
You have to cast it from object to ArrayList. NOTE: If you are using .NET 2.0 or higher you should use Generic Containers to avoid the casting.
led mike
|
|
|
|