|
Hi friends, am trying to build an interface for web service using http post method. Actually i have little knowledge about making this. I had done xml connectivity using post method and i know that. But i little idea about making the interface 4 web service. Please help me by sending any suggetions, example urls or example projects.
Thank u
|
|
|
|
|
|
Hi Ganesh, This nithin, thank u 4 sending this urls and much helpful for me.
One request is that these r all refers web service using SOAP method, can u guide me how to make an interface which can access using HTTP Post method.
Thanks,
Rgds
Nithin
-- modified at 0:23 Wednesday 29th November, 2006
|
|
|
|
|
Hi, here is my scenario...
i have the following in my solution...
App1 - normal application
App2 - normal application
CoreApp - library containing classes and 'core' functionality
App1 and App2 talk to each other via their sql server databases.
now, sometimes app1 and app2 may be installed on the same server, sometimes they are not.
so, if they are installed on the same box there will be a connection string to the other apps db in their web.config file.
if the connection string does not exist then i must call the other apps web service which will perform the db insert for me.
i made an interface, lets says its called IComms
it defines the method signature that allows app1 to put something in app2s database.
so to send a message i write this code in App2..
<br />
<br />
dim proxy as IComms<br />
'see if we have connection string for app1 database<br />
<br />
if getConfigSetting("App1ConnectionString").length = 0 then<br />
'use web service<br />
proxy = new app1.webservice<br />
else<br />
proxy = new CoreApp.dbCalls<br />
end if<br />
<br />
proxy.sendmessageToApp1("hello")
this is all very well, but the reference to app1s web service in app2 does not create an implementation of the interface on the proxy class.
is there any way round this or should i just design the app without the use of an interface?
---Guy H ( ---
|
|
|
|
|
hi,
when sending mails using SmtpClient, does it open connection each time I do .Send()
if yes how can i avoid it?
If no what is the mechanism used to send Email.
cheers
------------------------------
Its not the fall that kills you; it's the
sudden stop at the end.
|
|
|
|
|
Yes it does and no, you can't avoid it. Each time Send is called, it opens a connection, sends the email, then closes the connection. You can't get it to keep a connection open. THe only way to do what you want is to write your own implementation of an SMTP Client that specifically includes the functionality you're looking for.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hey everybody.
I would like to know speed differences between vb6 and C#. How much C# is slower because of the CLR? Do you know some good web site where this is tested?
Thanks in advance,
Fedor
|
|
|
|
|
I don't think anyone has tested VB6 against C#. Test it yourself if you have any doubts. But, I think you'll find that the .NET CLR doesn't make C# or VB.NET slower than VB6. I think you'll find just the opposite.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I assume that you mean how much slower managed code is compared to unmanaged, as the CLR (common language runtime) is not very different from how VB6 works. VB6 also has a runtime library, the difference is just that it's specific for VB6 and not shared with any other language.
Here[^] you can find a comparison between C#, VB6 and other languages.
As you see, C# is roughly twice as fast as VB6 for simple operations. When using objects the difference grows substantially, as C# is roughly 100 times faster than VB6.
The difference in performance when it comes to objects is largely due to the way that the managed code handles objects, so you see that managed code doesn't make C# slower, but in fact very much faster.
---
b { font-weight: normal; }
|
|
|
|
|
Thank you for answers. It helped a lot!
Regards,
Fedor
|
|
|
|
|
Hi All,
I need to know how can i call from application that i wrote in C++ in visual studio 6 a function from C# ( visual 2005 ) application ?
What i meen is call function in way like calling com interface function - ( in com i can call function from application X that i have pointer to it in application Y ).
Can i do it ?
Thanks for any help.
|
|
|
|
|
Expose the c# application (or at least the interfaces you are interseted in) as a COM object, use tlbexp to export a type library for early binding...
|
|
|
|
|
Thanks,
But can you eaplain or give some like to example how to do it ?
Im new in the .NET framework issue ....
|
|
|
|
|
Hi.
Does anyone know how can I make a control work without recieving the focus?
The thing is that I'm trying to simulate a kyboard (on a UserControl) which is added to a form. Whenevet a key is clicked, I use the SendKeys.SendWait method to simulate a keystroke. In order to process the simulated keystroke, the recieving form should be in focus. To achieve this, I use the SetFocus function (from User32.dll) with the handler of the recieving form. So far so good - it all works fine except for the slight occasional control bar flicker when changing the focus.
So - is there a way to avoid all that focus transfer?
|
|
|
|
|
Hi all,
I'm trying to get a collection of all the forms in my project on runtime. I've tried "Application.OpenForms", but this only gives me the current open forms in the project?
How could I get a collection of all the forms in my project so that I can display them in a listbox?
I want to create a list of forms in a listview for building a navigation interface on runtime.
Regards,
=============================
Rudi Groenewald
http://rudigroenewald.spaces.live.com
|
|
|
|
|
Use reflection to iterate through all the types in the current assembly/assemblies which inherit from System.Windows.Forms.Form
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
I am doing one of the Suggested Practices for the MCTS 70-536 exam prep book. The chapter 2 practice asks you to create an app that will search a drive for a particular file. So, I am trying to write a routine to search the c: drive for a file, but am having a problem with this:
DirectoryInfo[] dirs = dirInfo.GetDirectories("*.*", SearchOption.AllDirectories);
On this instruction it churns for a bit and then throws a System.UnauthorizedAccessException, and the Message of the exception is "Access to the path 'c:\System Volume Information' is denied."
If I change it to:
DirectoryInfo[] dirs = dirInfo.GetDirectories();
and recursively call the routine to search each subdirectory instead, it may find the file before the exception occurs, depending on what filename I give it. So, I cannot see how one could search a hard drive for a file using .NET.
Can anyone please help with this??
TIA
|
|
|
|
|
Windows is not allowing you access to "C:\System Volume Information". You'll need to find a way of searching through directories, ignoreing those which you don't have permission to access.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
If I cannot even get a list of the directories, how can I iterate through them to check their accessibility? I am using a Windows XP ID that has admistration abilities. I have not even tried to play with security issues yet using IDs that have limited access.
Is there any other way to get a list of the directories in c:\ ?
Thanks.
|
|
|
|
|
Nobody (normally anyway) should be able to access System Volume Information since it's integral to the NTFS file system (I seem to remember).
The following (can be recursive) code works:
ConsoleColor def = Console.ForegroundColor;
foreach (string directory in Directory.GetDirectories("C:\\"))
{
Console.WriteLine(directory);
try
{
foreach (string subdirectory in Directory.GetDirectories(directory))
{
Console.WriteLine("\t{0}", subdirectory);
}
}
catch
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("\tCould not iterate directory");
Console.ForegroundColor = def;
}
}
Console.ReadKey();
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
The GetDirectories() function returns an array of DirectoryInfo's, not strings. Besides, your code won't work either, since you have the foreach statement outside of the try block. It is on the foreach that it gets the exception. I just decided to pull the code out of the foreach statement so I could better figure out where it was getting the exception. So, I have this:
static void FindFile(DirectoryInfo dirInfo, string fileName, out FileInfo fileFound)<br />
{<br />
try<br />
{<br />
DirectoryInfo[] dirs = dirInfo.GetDirectories("*.*", SearchOption.AllDirectories);<br />
foreach (DirectoryInfo di in dirs)<br />
{<br />
if ((di.Attributes & FileAttributes.System) == 0)<br />
{<br />
FileInfo fileI = SearchDirectory(di, fileName);<br />
if (fileI != null)<br />
{<br />
fileFound = fileI;<br />
return;<br />
}<br />
}<br />
}<br />
}<br />
catch (System.UnauthorizedAccessException ex)<br />
{<br />
Console.WriteLine("Security EXCEPTION: {0}", ex.Message);<br />
fileFound = null;<br />
return;<br />
}<br />
<br />
catch (Exception ex)<br />
{<br />
Console.WriteLine("EXCEPTION: {0}", ex.ToString());<br />
fileFound = null;<br />
return;<br />
}<br />
fileFound = null;<br />
}
It bombs on the first instruction (GetDirectories). Thkx
|
|
|
|
|
Some points to note:
1) Directory.GetDirectories() returns an array of strings. Argue with the documentation & the code if you want but that's what it returns.
2) The code works just fine, I can copy and paste the results if you want but you may not understand them
3) Of course the code fails on the first line, you're still trying to recurse the directories, why my snippet did was demonstrate (perhaps too simply) that you needed to handle the recursion yourself so that you could continue searching rather than stopping when the exception occurred.
So in summary what you'll have to do is write a recursive routine which searches through a directory (not including the sub-directories), if it finds a file return it, if it can't read a directory then skip over it. And continue all the way through the loop.
sshhessh
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Oooooh. You are using Directory instead of DirectoryInfo!!! I see it now. Thanks. I will give it a go.
With my method I could not see how to handle that exception using the OOP design of .NET.
TY
|
|
|
|
|
i ned to enter urdu text in th text box wen i use multi line textbox it displays some characters as a box i.e. dsnt identify it... where as wen i use a single line text box it displays every character correctly how can i handle this
|
|
|
|
|
If the characters being displayed are near the line breaks maybe it has something to do with the line break characters you are using in the text box.
Maybe the problem has something to do with the string you are using to store the string. If you are using C++ .Net you might need to qualify strings you wanted to treat as unicode:
sampleText = S"some text";
When I worked on a project using Korean text we would sometimes find that certain character combinations were shown inaccurately. We were not storing our character strings as unicode.
|
|
|
|