|
There are many limitations for hosting form controls in IE. Odds are, you need to modify the programs permissions. Just run mscorcfg.msc and configure the assembly.
Hope it helps, else give more info.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
What do you mean
run mscorcfg.msc and configure the assembly.
I have no clue what your talking about.... try explaining it to me in 6th graders terms...
THANKS.
/\ |_ E X E GG
|
|
|
|
|
If you installed IIS after VS.NET you might have a problem with the aspnet_isapi.dll not being registered. Try running "regsv32 aspnet_isapi.dll" in the command window.
|
|
|
|
|
can you elaborate more I have no clue what your talking about.,....
/\ |_ E X E GG
|
|
|
|
|
I can try...
When you install IIS after you install VisualStudio, there might be a problem with the "connection" between the two. I had a problem with debugging asp pages, and IE did not display components, only HTML. To resolve this problem you can reinstall VS, but another way is to register the dll i mentioned. The command prompt is found under the start menu. Does that answer it? If not, specify what you dont understand.
|
|
|
|
|
im looking for a way to encrypt a file name..and still keep it a valid file name...and then beable to decrypt it just from the file name. I tryed using a RC2 encryption...and then coverting it to a base64 string but i get a error sometimes saying "could not find part of path name such and such".. is there another way to do this and still beable to decrypted the file name and return it to the original ?
Thanks Alot
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
I don't quite follow what you mean Jesse..
If you want to identify the file as being encrypted, you could just add your own unique extension on the end:
document.doc -> document.doc.enc -> document.doc
Then remove it when decrypting using the Path class to strip off your added extansion. This way there's no need to store any filename info in the encrypted data at all.
However, if you want to store the original filename in the encrypted stream, replacing with something totally unrelated like this:
document.doc -> encrypted.file -> document.doc
Then it's going to be a little trickier. What you need to do here is use the Path class the get just the filename (not the whole path) of the source file, then store the length of the filename string in the encryption stream, followed by the string name itself as bytes. When decrypting, you will need to read your filename length first, then read that amount of bytes to re-create the filename, then read & decrypt the actual file data.
|
|
|
|
|
thanks furty i found something that fixed the problem for me using RC2 and memory streams... i used that path class...and sent just the name to the seperate "class" where the name was encrypted and then returned.... apon decryption i send the "encrypted" name back...and it decrypted that string using the same password... you were write on the last part.. i just had no idea how to do it because when i did it...it would encrypt the string and return a name that was too long...for a valid windows file name. the following code encrypted the string and fixed the problem...
thanks... Jesse M
please keep in mind this encryption method i know isnt the correct way to do it...but its just for a file name.. so i did it the easyiest way =)..
public string FilterInName(string pToEncrypt){<br />
try{<br />
if(pToEncrypt.Length<=3){<br />
<br />
return pToEncrypt;<br />
}<br />
string sKey = "alPhatab";<br />
DESCryptoServiceProvider des = new DESCryptoServiceProvider();<br />
byte[] inputByteArray = Encoding.Default.GetBytes(pToEncrypt);<br />
des.Key = ASCIIEncoding.ASCII.GetBytes(sKey);<br />
des.IV = ASCIIEncoding.ASCII.GetBytes(sKey);<br />
MemoryStream ms = new MemoryStream();<br />
CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(),<br />
CryptoStreamMode.Write);<br />
cs.Write(inputByteArray, 0, inputByteArray.Length);<br />
cs.FlushFinalBlock();<br />
<br />
StringBuilder ret = new StringBuilder();<br />
foreach(byte b in ms.ToArray()){<br />
ret.AppendFormat("{0:X2}", b);<br />
}<br />
return ret.ToString();<br />
}catch(Exception ){return pToEncrypt;}
The Code Project Is Your Friend...
|
|
|
|
|
It seems that it's not possible, to fit a Windows Form in a Control (such as a Panel, for instance). I can think of a few good reasons why that's true, but I'm just doublechecking. It'd be pretty handy for me if I could fit a Form in a Control, so I don't have to replicate many things; MDI Forms in a Control would be even nicer.
|
|
|
|
|
Here's very quick fix (one I remember Paul Watson enjoyed):
Let your form inherited from UserControl instead (mite need 1 or 2 changes). Then just drop that in a form with filled docking.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
There are at least two ways to go about it, the first is the best way if you can modify the design which you have given above.
The second is what you'll have to do if you have no choice but to leave it as a Form. You won't get any design time support for it either, but something is better than nothing
Since the Form class inherits ultimately from the Control class it is possible for a Form to be added as a child control.
To do this, first create an instance of the Form (MyForm mf = new MyForm() ). Now set any properties you want on it, especially the Location , and Size properties. Now set the TopLevel property of the form to false (mf.TopLevel = false ). You may or may not see this property in the IntelliSense pop-up, don't worry it is there
Now add the form to the Controls collection, Controls.Add( mf ); . Lastly you need to make the form visible, mf.Visible = true .
All together now:
MyForm mf = new MyForm();
mf.Location = new Point( 8, 8 );
mf.Size = new Size( 150, 300 );
Controls.Add( mf );
mf.Visible = true;
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
Just some dry, semi sober humor for you folks
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
|
Go unsafe
Also post some code and give an explanation of the unmanged function you are trying to use. Your bets are string and StringBuilder, depending on the situation.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
see title
I see dumb people
|
|
|
|
|
See previous post
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
You probably don't need to since the marshaler does this as part of his job.
In case you are using .NET 1.0 and encounter marshaling limitations (there are a few bugs), you may do the marshaler's job by creating a block yourself : IntPtr pCharBlock = Marshal.AllocHGlobal(nSize); . More info here[^].
|
|
|
|
|
|
I have a varible that is declared in the main application form as public. How can I get at this varible from another form. I have tried accessing the forms varible via Form1.varible and this.ParentForm.varible and so forth. All to no avail and I need to have access to this varible from anywhere in the program. Any suggesttion would be greatly appreciated.
|
|
|
|
|
DId you cast it (the form) to your form before you tried to access it?
draco_iii wrote:
All to no avail and I need to have access to this varible from anywhere in the program.
I suggest making a "static" class then to hold these variables.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
Made the static class for the variable it look like this
<br />
using System;<br />
using Perpetual_Settings;<br />
namespace Brazen_Mail<br />
{<br />
public class Setting<br />
{<br />
public static Perpetual_Settings.PerpetualSettings test = new PerpetualSettings();<br />
static Setting()<br />
{<br />
test = new PerpetualSettings();<br />
}<br />
}<br />
}<br />
But when running the code I get this error.
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in system.windows.forms.dll
Additional information: File or assembly name Perpetual Settings, or one of its dependencies, was not found.
I can see the Properties and Methods from the class when trying access them via VS, but it craps out when I try and run the program.
|
|
|
|
|
Spaces in general is a BAD idea spawned from some VB coders on crack. NEVER use spaces. I assume your dll is called "Perpetual Settings.dll".
Spaces are used to space code elements, not making pretty names.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
Thanks. As soon as I got the space out of the name it worked perfectly. There needs to be a an article about making a static varible class. It is the best way I have seen to have global varibles.
|
|
|
|
|
this.ParentForm returns a System.Windows.Forms.Form class type, not your derived class.
In fact, this.ParentForm is mostly used for UI logic. For your application logic, it's better to either let the two forms know about each other existence or, better, share a property bag class (better in terms of decoupling).
|
|
|
|
|
How do you go about letting them know about each others existance or at least letting the child forms see full existance of the main running form? I need to be able keep one set of the varibles not multiple instances so that they can be written to or read from by any of the child forms. Doing so, would allow less overhead and insure that all of the child forms are working from the same set of "settings".
|
|
|
|