|
Not sure if I understand you, but if you have problems with hardcoding the URL in your program, then you can easily build the URL at runtime:
string myUrl = "http://" + server + ":" + port + "/My/Web/Service/Object.soap"; with the opportunity to enter the server and port at runtime or you can use a config file to set up your remoting environment. Look up RemotingConfiguration.Configure() .
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
oh,thanks,i will hava a try
|
|
|
|
|
The constructor of ObjectDisposedException take a mandatory string argument.
I never know what string to use and I tend to use the following:
"this"
GetType().Name
"Handle"
What is it supposed to be?
|
|
|
|
|
Please don't cross post.
It's supposed to be the name of the disposed object. The name is used in the error message that is created.
---
b { font-weight: normal; }
-- modified at 6:39 Sunday 25th June, 2006
|
|
|
|
|
I didn't know object have a name!
According to my documentation:
public class Object
{
public Object();
public virtual bool Equals(object obj);
public static bool Equals(object objA, object objB);
public virtual int GetHashCode();
public Type GetType();
protected object MemberwiseClone();
public static bool ReferenceEquals(object objA, object objB);
public virtual string ToString();
}
There is no 'name' property in object....
|
|
|
|
|
No, the object itself doesn't have a name. It's what ever you call the object.
---
b { font-weight: normal; }
|
|
|
|
|
doesn't work either.
because, usually it's the disposed object itself which throw the exception, so it calls itself "this".
never mind, I will use GetType().Name
(or perhaps I directly type the classname)
|
|
|
|
|
i have a win app. i want to send some info to a web app but the web app has no web service. plz help me.
|
|
|
|
|
I'm fairly new to Managed DirectX, but I'm having a lighting issue. For my app, I'm using a single light to reflect off of a cylinder that has multiple colors around it. Whenever I run the application on my machine the colors are shown fine. However, any other machine I install the simple app on (created using Visual Studios' Setup and Deployment wizard), the cylinder appears completely black.
In the code I check the machines video card for lights, and it returns positive. Even when I set the devices.RenderState.Ambient for the machine, it still comes out black. I've tried installing the app on several machines with no luck.
Any advice??
|
|
|
|
|
When I override the == operator in class A. How do I know if an A object is null?
if (A == null)
Will call my overriden method and throw a null reference exception.
|
|
|
|
|
|
Well then test it in your overloaded operator if
a) both arguments are null -> return true
b) only one of both arguments is true -> return false
c) do your normal comparison
|
|
|
|
|
I am posting this question in both the C# and C++ boards as I think the solution may be the same in both the cases.
I have an IE toolbar which gets hold of the IWebBrowser. I then imlplement the event DocumentComplete. In the event I get hold of the Document as a IHTMLDocument.
now here is my question. For an image in the Document, how do I get to know the exact path of that image in my temporary Internet files? If I get the images list, then for each element in the collection I can get the src property but that gives me the url not the location in the temp internet files. I know the file may not exist in the temp folder, but if it did, is there a way to get the path?
Thanks
|
|
|
|
|
|
Hello,
I have a very strange problem with the WebBrowser control... When the WebBrowser control have the focus, all my main menu strip shortcuts stop working, and when I set the focus to another control it start working correctly.
How can I solve that?
Your help would be greatly appreciated.
|
|
|
|
|
What do the menu items do? The Browser Control is not a "windows control" like a Edit control or List control. It is actually a pretty large "program" wrapped into an ActiveX control so you can't expect to work with it like a Edit control or Button.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
How could i read the CaptureBuffer into a MemoryStream and write it into SecondaryBuffer???
for reading the CaptureBuffer into an array (CaptureData) it works fine:
<br />
private void RecordCapturedData()<br />
{<br />
byte[] CaptureData = null;<br />
int ReadPos;<br />
int CapturePos;<br />
int LockSize;<br />
<br />
applicationBuffer.GetCurrentPosition(out CapturePos, out ReadPos);<br />
LockSize = ReadPos - NextCaptureOffset;<br />
if (LockSize < 0)<br />
LockSize += CaptureBufferSize;<br />
<br />
LockSize -= (LockSize % NotifySize);<br />
<br />
if (0 == LockSize)<br />
return;<br />
<br />
CaptureData = (byte[])applicationBuffer.Read(NextCaptureOffset, typeof(byte), LockFlag.None, LockSize);<br />
<br />
soundBuffer.Write(0, CaptureData, LockFlag.EntireBuffer);<br />
<br />
soundBuffer.SetCurrentPosition(0);<br />
<br />
soundBuffer.Play(0, BufferPlayFlags.Looping);<br />
<br />
NextCaptureOffset += CaptureData.Length;<br />
NextCaptureOffset %= CaptureBufferSize;
}<br />
|
|
|
|
|
I have put a lot of effort in order to build a class that encrypt ConnectionString or any other key/value arument in the App.config configuration file.
The problem I am facing is that the EncrypKey variable (string) I am using to hold the encryption key is shown in the ildasm utility as a part of the class assembly.
This issue was never a problem in C++ or VB as they are nativ programming languages, but the C# in .NET anvironment is an "open source code" to all whome consirn
I will apretiate very much a good solution in order to finnish the task I am facing of encryption of ConnectionString to a data-base.
I hope the solution will not be to write a DLL in nativ programming language such as C++ or VB and in this machine-code DLL to put the encription key I am using in the C# program. I do not have the knowladge for doing such a task (connecting between C# program and C++ DLL) and it is like saying that C# has a prity big disadvantege on native languages.
Here is what the ildasm showing when I look at the assembley of the encripting class.
Please notic that "SuperSecret" is the encryption key I am using in order to encrypt and decrypt ConnectionString value in App.config file.
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// Code size 46 (0x2e)
.maxstack 5
IL_0000: ldarg.0
IL_0001: ldnull
IL_0002: stfld class [System]System.ComponentModel.Container SetAppConfig.Form1::components
IL_0007: ldarg.0
IL_0008: call instance void [System.Windows.Forms]System.Windows.Forms.Form::.ctor()
IL_000d: ldarg.0
IL_000e: ldstr "App.config"
IL_0013: ldstr "ConnectionString"
IL_0018: ldstr "SuperSecret"
IL_001d: newobj instance void [iConUtils]iConUtils.appConfiguration::.ctor(string,
string,
string)
IL_0022: stfld class [iConUtils]iConUtils.appConfiguration SetAppConfig.Form1::AppConfig
IL_0027: ldarg.0
IL_0028: call instance void SetAppConfig.Form1::InitializeComponent()
IL_002d: ret
} // end of method Form1::.ctor
Regards
yoffir
|
|
|
|
|
|
yoffir wrote: facing of encryption of ConnectionString to a data-base
Why encrypt your connection string? If you are concerned about the database password, then using a "Trusted Connection" is the ticket.
|
|
|
|
|
|
Colin Angus Mackay wrote: And it is the recommended way to connect to a database.
And I don't even think of using any other way of connecting to a sql database than trusted connection
PJC
|
|
|
|
|
Hi!
You'll always have a problem keeping secrets secret, but there indeed is something you can do.
If you need a symmetric encryption (like in your case), then placing the key inside an assembly is not a good ides, you're right.
One solution that comes to mind is to create the key at runtime.
At any point in your application's life cycle, you'll have the connection string unencrypted. Then you could create a random key and store this key in a safe place (a protected registry key or an isolated storage). Now encrypt the string with the random key and write it to your config file.
For decrypting you can get the key from the registry or IS and you'll be fine.
That way you don't have to hardcode any secret inside your assemblies. But you have to be careful nevertheless that the method creating and storing the random key isn't being executed by an untrusted caller, or else this caller could easily manipulate the connection string (although it's not so easy to find out the secret key, but he doesn't have to - your method does all the "dirty work" for him).
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
I do not know how to invoke windows API in C# ,who can help me.
No begin no end.
|
|
|
|
|
www.pinvoke.net - now type in the API you want to invoke and search for it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|