|
hi i have one problem .
how i can replace string for image for example :
i write ":)" and i wan't replace to the image
how can i do in a textbox or richtextbox ?
|
|
|
|
|
Can't be done in a TextBox.
Use Google to find an RTB solution, and you discover this one[^] and many others.
|
|
|
|
|
Why can't we make an event in c# without a delegate as eventhandler, like you can in vb.net ?
Learning without thought is labor lost; thought without learning is perilous. (Confucius)
|
|
|
|
|
Events in C# and VB.NET work the same way. If you're refering to the WithEvents keyword, it's just syntactic sugar for having the manual stuff done for you.
|
|
|
|
|
If you don't want to bother creating your own custom delegate you have two other choices in c#
1. Use an inline delegate.
2. Use Generics eg. EventHandler<T>
In VB.Net you also have two options in addition to creating a custom delegate>
1. Use Generics
2. Use WithEvents
WithEvents works rather differently as it gives you rather more than just syntactic sugar, it also deals with reattaching the event handlers to the new object if you change the object referenced. You can even define the event handlers before initialising the object that raises the events.
In C# you have to do that yourself, and you have to have an instance before you can hook up events.
So, C# or VB.NET you can roll your own.
C# you get inline delegates
VB.NET you get less code for complicated event handling scenarios.
Personally I would rather have a little more code that shows me what is really going on. Then it is easier to realise I didn't need half of it in the first place!
|
|
|
|
|
Excellent reply.
Again c# seems to be a lot clearer.
Learning without thought is labor lost; thought without learning is perilous. (Confucius)
|
|
|
|
|
Thanks.
I use c# for my own projects, and VB.Net at work, so I get to see both sides of the coin, and struggle to get the two to do the same. I do prefer the flexibility and control in c#, but some of the RAD tools embedded in VB.Net are excellent.
I wish it were possible to code classes in the same project in different languages so I could use the most appropriate one for the task at a class level. If that included managed C++ for some of the restricted stuff like Extended MAPI then even better.
|
|
|
|
|
Hi,
I want to upload a xml file on Rest web server using vb.net
Can any one suggest how i do this.
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
http://www.youtube.com/watch?v=-oJaaPCrk3Q
|
|
|
|
|
It depends on the server. Do you have any documentation of the server API?
On some servers it is done using the HTTP method - PUT others have POST. Without knowing what server and the API it supports it is not possible to anwer your question exactly.
|
|
|
|
|
|
Thanks for reply,
But this is for design the web service for upload a file. but i want to upload a xml file on rest web service using my .net code.
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
http://www.youtube.com/watch?v=-oJaaPCrk3Q
|
|
|
|
|
Hi,
I am writting an ASP.NET application in VS 2008. I have some COM component written in VC++ 6.0 as a DLL. I Have add reference of COM DLL in my ASP.NET application. In my application I am calling methods from COM DLL which I want to debug but I am not able to debug my COM DLL. Can any one help me how to debug? I am using IE8 on my machine.
thanks in advance.
Yudhisthira
|
|
|
|
|
Run Asp.net application with visual studio 6.0 for VC++ dll Debugging.
|
|
|
|
|
how to run? how to attach dll to ASP application?
|
|
|
|
|
i hav did the same 7 years ago... don't knw the exact tool options....
|
|
|
|
|
M_SqlPathName = dsExecu.Tables(1).Rows(0)("AppSet_PhysicalPath") + Utilities.Dtgetsource.Rows(J)("FileDir") + Utilities.Dtgetsource.Rows(J)("FileName")
Dim sqlcmdsql As New SqlCommand
sqlcmdsql.Connection = sqlCon1
Dim fileInfo1 As FileInfo = New FileInfo(M_SqlPathName) --up to this line of code am getting the server path as D:\attachment\JON103\SQLQuery11.sql
Dim script As String = fileInfo1.OpenText().ReadToEnd() --then in script am not getting any path so it throws null exceptional error
SqlScript = script
pls anyone chk this out and tell me how to get the server path and upload the excel file to it
|
|
|
|
|
If D:\attachment\JON103\SQLQuery11.sql does not exist, fileInfo1 will be null ('Nothing' in VB). Ensure that the file exists.
modified on Monday, December 7, 2009 5:38 AM
|
|
|
|
|
Dim fileInfo1 As FileInfo = New FileInfo(M_SqlPathName) --up to this line of code am getting the server path as D:\attachment\JON103\SQLQuery11.sql
Dim script As String = fileInfo1.OpenText().ReadToEnd() --then in script am not getting any path so it throws null exceptional error
SqlScript = script
in M_SqlPathName am getting the above directory root name, but in next stept script=fileInfo1.OpenText().ReadToEnd() it throws an error, object reference
|
|
|
|
|
I think my previous answer was quite clear. JUST ENSURE THAT THE FILE EXISTS, if it does not exist, you will get this error.
Hint: You may use File.Exists() method to skip files that do not exist.
|
|
|
|
|
hi all,
i need a help... need to create a dynamic sub folder to store particular job_id's excel files within the sub folder with job_id's name, here the job_id is identity column.. say for eg., JON101, JON123, etc...
sqlcmdsql.Parameters.AddWithValue("@fullFileName", "C:\Bcp\" + Utilities.Jobid + ".xls")
the above code is for generating excel file within common folder, now i need to create sub_folder...
anyone came across this issue, pls help me to resolve
|
|
|
|
|
//this is code to create folder....
private string CreateFolder(string FolderName)
{
if ((!Directory.Exists(@"D:\ " + FolderName + "")))
{
DirectoryInfo oDirectoryInfo = default(DirectoryInfo);
oDirectoryInfo = Directory.CreateDirectory(@"D:\ " + FolderName + "");
}
}
|
|
|
|
|
//to move data from one folder to another
DirectoryInfo dir1= new DirectoryInfo("F:Folder1");
DirectoryInfo dir2 = new DirectoryInfo("F:Folder2");
FileInfo[] Folder1Files = dir1.GetFiles();
if(Folder1Files.Length > 0)
{
foreach(FileInfo aFile in Folder1Files)
{
if(File.Exists("F:Folder2" + aFile.Name))
{
File.Delete("F:Folder2" + aFile.Name);
}
aFile.MoveTo("F:Folder2" + aFile.Name);
}
}
|
|
|
|
|
//Create folder in server
fso = Server.CreateObject("Scripting.FileSystemObject");
fso.CreateFolder("d:\New Folder1");
//example 2
System.IO.Directory.CreateDirectory(Server.MapPath("path_name")+ "\\NewFolder1");
|
|
|
|
|
hi friends,
i am new to .net.please help with the code ,that can display the items from a tab control to the flowlayout control.
i have tab control which contains few buttons and when these buttons are double clicked ,flow layout must show that buttons irrespective of tab pages.if there is a solution to this, provide it with me as early as possible.
i am urgent friends........
|
|
|
|
|
In my crystal report I want to have two detail sections with a seperate header section for each.I mean I want the headers to appear right at the top of their corresponding detail sections . But in the section expert there is no way to change the sections order.How can I achieve the result ?
|
|
|
|