|
Hi,
I am stuck I cant find a simple example of Using Windows Forms Controls in Internet Explorer written in VB.net 2.0,
i want to build a bulk emailer that will run in a web-browser on the client side that will get the email addresses and email message to send from the previous asp.net webpage, like an activex control but cant find anything in wriiten vb.net and all the C# things I have found are overly complicated and dont covert to vb too well.
Anyone who could point me in the right direction would be greatly appreciated I have spent 2 days searching the net and cant find anything of any use.
Thanks i advance
|
|
|
|
|
GDMFSOB wrote: and all the C# things I have found are overly complicated and dont covert to vb too well.
Odds are they are as complex as they need to be. 100% you can convert them to VB and they will work fine.
To use windows forms controls, you need to write a browser plug in, you can't just add them to a web form like you do a web control. And it will mean your users will need to have .NET installed.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for the reply,
you said : "you need to write a browser plug in", this is completely new tech to me I am used to writing iether a standalone app or a asp.net webpage, not mixing the two and dont know where to start, i just tried writin a user conotrl, compling and then added this <object width="430" height="352" classid="OCTBulkMailer.dll#UserControl"></object> but all I get a a blank looking image place holder, LOL I know I must sound a bit like a retard but its like showing me a car and handing me the keys but I dont know what a car is or what it does.
|
|
|
|
|
To be honest, I've never written a control to be consumed by .NET, because it's a little user hostile, IMO.
http://msdn.microsoft.com/msdnmag/issues/02/01/UserCtrl/[^] looks like what you need.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Thanks Christian, I saw that article already and but its in old .net and needed to be converted the converted version does not work so it looks like this stuff has not be covered on .net 2 yet i will carry on looking thanks for your input so far
|
|
|
|
|
I have a related question. I am sure VB 6 has ActiveX Control support. But my generic queries are:
1) Compared to developing in VC++ or MFC, wouldn't this mean by dependency on VB Components. I have a weak doubt that controls made out VB need VB Runtime Library or something like that (Pardon me for my bad memory that I could not recall)
2) Wouldn't there be any pitfalls having a control engineering out of VB compared to a control from MFC?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
well my understanding is that ActiveX has been discontiued in .net and using windows forms controls is supposed to be the way to do it, but if I am going to run into problems with running on non windows system this will not be good, so anybody who know please give your input last thing I want to do is build this thing and it doesnt work accross the bourd, what about using the .net framework on the server to run the app on non windows systems?
|
|
|
|
|
GDMFSOB wrote: ActiveX has been discontiued in .net and using windows forms controls is supposed to be the way to do it
They can not do that outright. Not everyone would be capable or interested to download a huge bloated 23 MB runtime to view a little control.
GDMFSOB wrote: with running on non windows system
This question itself should not come into this discussion. Since both the solutions we are trying to focus on (Windows Forms Vs ActiveX) are only for Windows Internet Explorer. Other browsers on Windows as well other platforms may be totally ignorant of these technologies.
And regarding my query to Graus, my only apprehension was whether a control through MFC VC++ and VB would be identical or any pitfalls would be there?
Without any preconcieved notions and prejudices, if we are trying to get a cross-platform cross-browser solution, I feel that we have to take the Java Applet route. There might be a vote down of this view. But I would appreciate, if some one votes down also clarifies and illuminates the arena.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
You can actually create ActiveX controls in .NET, ActiveX is just COM. But, there's no point, that I can see.
GDMFSOB wrote: but if I am going to run into problems with running on non windows system this will not be good
By definition, a windows forms control is not going to run outside of a windows machine.
GDMFSOB wrote: what about using the .net framework on the server to run the app on non windows systems?
Not possible - the control is not running on the server. Your server has .NET by default, if the pages are ASP.NET, but the client needs it also to run a .NET control locally.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yes, I work on a site which has a VB ActiveX control, and users need first to download the VB runtime before they can use it.
Vasudevan Deepak K wrote: Wouldn't there be any pitfalls having a control engineering out of VB compared to a control from MFC?
Only that VB sucks
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank you. That was a good eye-opener.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
|
Any ideas how to improve deserialisation for binary data when reading from file for DataTable.
Becouse I tested deserialisation from binarry file and compared with the same data using MySql Database and got strange results that from Database reads and fills ~2x times faster to DataTable then Deserialise and read from finary file stream. I serealised as binary data of DataTable to file.
I tested deserialisation and the same functions for SortedArrayList and similar HashTable arrays works ~6x times faster that reading the same data from Database.
May anybody know how to improve deserialisation or are exist any algorithms for DataTables or DataSets a lot faster then I founded method?
Here a code example in VB.NET that I use for deserialisation of binary data from file for DataTable:
Public Shared Function DeserializeByte(ByVal b As Byte()) As Object
If b Is Nothing Then Return Nothing
Dim f As Runtime.Serialization.IFormatter
Dim ms As System.IO.MemoryStream = Nothing
Dim obj As Object = Nothing
Try
f = New Runtime.Serialization.Formatters.Binary.BinaryFormatter()
ms = New System.IO.MemoryStream(b)
obj = f.Deserialize(ms)
Catch ex As Exception
Finally
If Not ms Is Nothing Then
ms.Close()
ms.Dispose()
End If
End Try
Return obj
End Function
And here file reading, may nead improve:
Public Shared Function ReadBytesFromFile(ByVal sFileName As String) As Byte()
Dim b As Byte() = New Byte() {}
Dim fs As System.IO.FileStream = Nothing
Dim iLen As Integer = 0
Try
fs = New System.IO.FileStream(sFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)
iLen = CType(fs.Length, Integer)
b = New Byte(iLen) {}
fs.Read(b, 0, iLen)
Catch ex As Exception
Finally
If Not fs Is Nothing Then
fs.Close()
fs.Dispose()
End If
End Try
Return b
End Function
Here translated code for C# users:
public static object DeserializeByte(byte[] b)
{
if (b == null) return null;
Runtime.Serialization.IFormatter f;
System.IO.MemoryStream ms = null;
object obj = null;
try {
f = new Runtime.Serialization.Formatters.Binary.BinaryFormatter();
ms = new System.IO.MemoryStream(b);
obj = f.Deserialize(ms);
}
catch (Exception ex) {
}
finally {
if ((ms != null))
{
ms.Close();
ms.Dispose();
}
}
return obj;
}
public static byte[] ReadBytesFromFile(string sFileName)
{
byte[] b = new byte[];
System.IO.FileStream fs = null;
int iLen = 0;
try {
fs = new System.IO.FileStream(sFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read);
iLen = (int)fs.Length;
b = new byte[iLen + 1];
fs.Read(b, 0, iLen);
}
catch (Exception ex) {
}
finally {
if ((fs != null))
{
fs.Close();
fs.Dispose();
}
}
return b;
}
P.S. If somebody post in C# or in VB.NET no was a problem, I understand both languages.
|
|
|
|
|
Hi
I am using visual web developer to create my website
I want to put this website on a web server that we are using for hosting
Is there a way to compile a DLL through VWD or how do i put it up there without using copy website tool
thanks
|
|
|
|
|
whatwould be the asp.net coding for login page and browse button
|
|
|
|
|
gag87 wrote: whatwould be the asp.net coding for login page and browse button
No one is going to give you the code. Have you attempted to research the answer to your question? There is plenty of information on MSDN relating to ASP.NET security. Or are you just another lazy, stupid developer who wants their work done for them?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
You won't get a Direct code Written for Your requirement.
Go for some references about ur question.
Surely, U will get directions and some guidelines for that but no CODE
Believe Yourself™ :->™
|
|
|
|
|
hi gag87,
There is no person going to help you by sending code to you directly. We can show you articles which you need to understand by yourself only, if problem persist then ask query to forum. Please visit the following link.
Click Here
Hope you understand, try to make you problem solved.
Thanks & Regards
Dilip Kumar Vishwakarma
|
|
|
|
|
Hi All!
I have some email address (almost 250) in database. I want to send a newsletter to each of them. But the problem is that I didn’t want to give comma separated list in To filed or didn’t want BCC of email. I want that each user get his email in To filed of email so he think that it is only send to him.
I am thinking to send via for loop on each email and then send. But I think it slow down the whole process. Looking forward for your suggestions.
Note: I am using ASP.Net 1.1 with sql server 2000
Thinkers
modified on Thursday, February 07, 2008 3:57:03 AM
|
|
|
|
|
|
But i need it using asp.net(C#)
|
|
|
|
|
Hello guys you really did the best for me.I am still new in programming world.
and Forgive me,for my poor English,I was successfully able to Upload my Binary file to the database but the challenging part came when I was trying to Download those binary file Like Pdf,doc FROM DATABASE
this is my DAtabase
CREATE TABLE ATTACHMENT
AttachmentID INT (PK),
FName varchar(50),
TYPE varchar(200),
Logo picture,
//Path varchar(200)
I don't want this code to download binary file from path all I need is to download from database as attachment,one of important thing,HOW TO use MemoryStream
this the code I used it on my website
protected void btnDownLoad_Click(object sender, EventArgs e)
{if (drpAttachmentID.Text != "select")
{SqlConnection cnn = null;
try{string display = " select Logo from Attachment where AttachmentID = '" + drpAttachmentID.Text + "'";
cnn = new SqlConnection(sqlcnstr);
SqlCommand cmd = new SqlCommand(display, cnn);
cnn.Open();
SqlDataReader reader = cmd.ExecuteReader();
if (reader.HasRows == true)
{ reader.Read();
Response.ContentType = "application/octect-stream";
Response.BinaryWrite((byte[])reader["Logo"]);
Response.AddHeader("Content-Length", byteArray.Length.ToString());}
else{ this.RegisterClientScriptBlock("alertMsg", "<script>alert(no Image);</script>");
}reader.Close();}catch (Exception err)
{lblMsg.Text = err.Message;
}
}
else
{ lblMsg.Text += "Please select AttachmentID 1st ";}
}//end
THIS CODE IS ONLY ABLE TO DOWNLOAD THE PICTURE BUT CANNOT DOWNLOAD DPF,DOC
from kagisobk@gmail.com
THANKS FROM ALL OF YOU GUYS
<div class="ForumMod">modified on Thursday, February 07, 2008 2:49:27 AM</div>
|
|
|
|
|
Can you try using Response.WriteFile or Response.TransmitFile ?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hi all
i have a doubt i.e
is it possible to call a function(not javascript function) on anchor tag onclick.
i wrote a function in aspx code page and i want to cal that function on anchor tag onclick.
can you plz help me...
thank you
siri
|
|
|
|
|
Hi,
Definately it is possible.
you have to make ur anchor tag as runat="server" than define onclick="function_name"
Hope this helps you.
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|