|
Richard Hartness wrote: Assuming that you have heard of them (which I would assume is likely) you may know that both of your concerns can be addressed.
Yep, I have. I didn't know which libraries you were referring to, sooooo, I couldn't be sure if it was a "good" library.
|
|
|
|
|
They are good - for they are code from the mighty Josh. Sing it with me - All hail to Josh.
|
|
|
|
|
Hi friends,
I need an answer about C# and .NET Framework. I explain the situation below.
I wrote a C# application. There is no problem, program is running properly.
Now, I have 4 clients and 1 server. All machines are windows xp pro.
I put this c# application (exe, assembly) on that server in a shared folder then I put shortcuts in clients desktop. I am clicking a shortcut from any of clients but my assembly is not working. All clients have .NET Framework 2.0 and I made some settings using Control Panel->Administrative Tools->.Net COnfiguration Wizard in these 4 machines. I am sure, all you know that in this tool we need to set trust level of local intranet to "Full Trust" and I did so. Also, permission of the shared folder in the server is set to Everyone->full access...
But when I tried to give a assembly path which is on a server in the clients using Microsoft .NET Framework 1.1 Wizards -> Trust an Assembly, I have an error that says "Unable to load assembly"...
So dear friends, what is the problem? For example all the clients are running word, excel files in the server or other programs...
Please help me,
thank you.
|
|
|
|
|
Try a better header in future - everyone needs an answer.
The fact you're using a .NET 1.1 wizard on a .NET 2.0 app seems like an issue.
Running an app from the central server kind of sucks, why are you doing that ? If you copy the files to the clients, does it work ?
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 )
|
|
|
|
|
I am sorry for the header...
You are right, of course I can install my application to the clients and then run it. But my application is database driven application and I just do not want to write extra code for remote machine database access. I have a little time and I want to run an application form network share. But if I can't, I will write some codes (based on XML) for client configuration then install that one...
Thanks.
|
|
|
|
|
The you need to use Remote Desktop or Terminal Services on the client to connect to the server.
then you can run your app on that remote session.
even given the "shortcuts" you've created (if they were to work), the app will still run on the client and then you have a client/server app anyway.
So, if you don't want that, then you need to use RDP/TS or Citrix metaframe.
Silence is the voice of complicity.
Strange women lying in ponds distributing swords is no basis for a system of government. -- monty python
Might I suggest that the universe was always the size of the cosmos. It is just that at one point the cosmos was the size of a marble. -- Colin Angus Mackay
|
|
|
|
|
Hi to all,
I have following problem in datagrid setting in .Net 1.1
I have used following code to place DateTimePicker in datagrid:
private WithEvents dtpGeneric as DateTimePicker
IN MOUSE_dOWN:
dtpGeneric=new DateTimePicker
With dtpGeneric
.Format = DateTimePickerFormat.Custom
.CustomFormat = "dd MMM yy"
.Dock = DockStyle.Fill
End With
I have set this format for the control used in datagrid.
Now i want the same format in datagrid cell
Please tell me, How do i do this?
Poonam
|
|
|
|
|
In one project, I have two classes containing #include < windows.h> in both .cpp files. Class 1 has macro of including the class 2 in the .h file.
Class1.h
#include "class2.h"
Class1.cpp
#include < windows.h>
Class2.cpp
#include < windows.h>
During compilation, I received following warning message:
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\Windows.h(16) : warning C4005: '_WIN32_WINNT' : macro redefinition
command-line arguments : see previous definition of '_WIN32_WINNT'
What is solution to avoid this warning?
|
|
|
|
|
This is not a .NET framework question at all, but the answer is to include windows.h in your std.afx file, I reckon.
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 )
|
|
|
|
|
where can i get this tool which can use a combination of adding declarative security and rewriting bytecode to ensure that an untrusted module can be safely used. The code rewriter will use Microsoft’s ILDASM disassembler to get a disassembled text file. It then will parse this file and create a
second assembly text file containing the modifications. Finally the modified assembly is reassembled using Microsoft’s ILASM assembler.
The rewriter will allow the user to pick from a simple list of functionality that the DLL should be allowed to perform. Following are the basic permissions that may be granted to an assembly:
* Execute: this means that the assembly will be allowed to load and execute.
* Display user interface: this allows the assembly to create SafeTopLevel windows and also to read and write data from its own clipboard.
* Access isolated storage: allows the assembly to create an isolated storage file (as described in Section 3.1, with the specified quota.
* Files via Windows dialogs: allows the assembly to read and write files; however, the assembly can not specify filenames. It can display Open and Save dialogs, and then read and write the files that are selected by the user only.
* Network sockets: allows the assembly to communicate with network sockets.
* Serialization of binary data: allows the assembly to read and write binary data via serialization.
In case that the developer needs finer grained control of the permissions given to an assembly. The advanced tab, may be used to allow or
deny any permission attribute defined by the .NET
framework
though a lot of ground has been covered in the topics code access security part 1 and 2 i was just wonderiing if someone has developed such gui tool i am talking about.
thanks in anticipation of a reply...
sahil
|
|
|
|
|
Hello there guys.
Firstly Im sorry if I this is the wrong place to post this.
I have a problem with IIS.Each time I try to browse my webpages(its from my home machine), I get the error "An unhandled win32 exception occured in mmc.exe[4760].
Then it asks me to debugg the site.I have tried to google the solution to this and Im not getting anything.
Can someone please help me.
Thanx in advance.
kagiso
|
|
|
|
|
how to zoom and pan an image using asp.net 2.0 with c#?? Or using AJAX in it.
|
|
|
|
|
I copied the form files (Form1.h, Form1.resX, Form1.cpp) from one project to another. When I opened the new project, the desinger view is lost from the Form1.h and the link between Form1.resX and Form1.h is lost as well. How to fix problem?
|
|
|
|
|
|
Hi All,
I am making a generic custom collection class as following:
Snippet:
public class MyCollection<specifictype> : IEnumerable
{
...
}
Internally how should I store the items so the class can be used for any type. For example, I can not use List<> as then my internal code will break if the type is not the same as the one declared in the List<>. If I use ArrayList then I am thinking it will hinder performance as it has to box and unbox. Does this mean the only option I have is to use simple array?
Thanks,
CodingYoshi
|
|
|
|
|
Rather than reinventing the wheel, take a look at Collection<T> available in .NET 2.0.
It will behave as a collection for serialization and deserialization purposes, allows strong typing, allows all the interfaces and data binding of a collection, and best of all, doesn't require you to write your own custom collection.
It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein
|
|
|
|
|
Hi Patrick,
I am not reinventing the wheel but I need to add some methods of my own along with the other methods already there, i.e. Add, Remover etc. Furthermore, it would be nice to know how to write one anyways. I am well familiar with Generics in .NET 2.0.
Any other advice?
Thanks,
CodingYoshi
|
|
|
|
|
You can inherit collectionbase, and add your own add/remove/indexer, etc.
|
|
|
|
|
CodingYoshi wrote: Any other advice?
You could do as darkelv says, and inherit from CollectionBase, or you could inherit from Collection<T>.
One common approach is to inherit from Collection<T> but not expose the collection as a generic collection - in other words you'd inherit from Collection<string> for example and call your object StringCollection. This would be if you don't want to expose the collection type in your external API.
It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein
|
|
|
|
|
Hi.
I am using MOSS 2007 and trying to change the title border of the web - parts.
I have managed to use 3 pictures - left, middle and right - to appear as border on the web - part title, but I have problems with alignment even though all the picture are same size. The problem is that the left and right pictures get 1 px under the middle picture.
I use this code wich I found on this site, but it doesn't work out for me.
.ms-WPHeader td { background: url('webpartBg.gif') top left repeat-x; padding-right: 0 !important; }
.ms-WPHeader h3.ms-WPTitle { background: url('webpartCornerLeft.gif') top left no-repeat; color: #BD8C2A; }
.ms-WPHeader .ms-HoverCellInActive, .ms-WPHeader .ms-HoverCellActiveDark { background: url('webpartCornerRight.gif') top right no-repeat; padding: 7px 5px 5px 5px; }
.ms-WPBody { padding: 0 5px 5px 5px; }
.ms-WPBorder { border-color: #FFECC5; }
.ms-partline { background: #FFECC5; }
.ms-WPTitle { padding: 7px 0 5px 10px; }
.ms-WPTitle a { color: #BD8C2A; }
http://www.thesug.org/blogs/kyles/Lists/Posts/Post.aspx?ID=9
Any suggestions ?
|
|
|
|
|
Hello everybody,
I was playing around with the new .net 3.5 ECDsaCng elliptic curve class of the System.Security.Cryptography namespace and have encountered a problem with importing a previously exported private key. The strange thing is that importing a public key works fine, but importing a private key always fails with a cryptographic exception, although I am calling the import function properly, as far as I can tell.
Before this drives me nuts, I thought I should post the code here - maybe someone can have a look at it and check whether I am missing something, or whether this is a bug within the ECDsaCng class itself.
Here's the VB2008 code - the section where the error occurs is marked (bottom of function)
<br />
<br />
Imports System.Security.Cryptography<br />
<br />
Public Function CreateSignature(ByVal strString As String) As Boolean<br />
<br />
'The exception occurs in the 'objCngKey = CngKey.Import' line on the bottom<br />
<br />
Dim data() As Byte<br />
Dim bSignature() As Byte<br />
Dim sSignature As String<br />
Dim objCngKey As CngKey<br />
Dim keyName As String = "ECDSA Key"<br />
Dim publicKeyBytes(), privateKeyBytes() As Byte<br />
<br />
'Check if CngKey exists - if so, delete it, if not create a new pair of keys<br />
If (CngKey.Exists(keyName)) Then<br />
objCngKey = CngKey.Open(keyName)<br />
objCngKey.Delete()<br />
Else<br />
Dim creationParameters = New CngKeyCreationParameters()<br />
creationParameters.ExportPolicy = CngExportPolicies.AllowPlaintextExport<br />
objCngKey = CngKey.Create(CngAlgorithm.ECDsaP256, keyName, creationParameters)<br />
End If<br />
<br />
'Export the public and the private key to byte arrays<br />
publicKeyBytes = objCngKey.Export(CngKeyBlobFormat.EccPublicBlob)<br />
privateKeyBytes = objCngKey.Export(CngKeyBlobFormat.EccPrivateBlob)<br />
<br />
'Convert String to be signed to a byte array<br />
data = System.Text.Encoding.Default.GetBytes(strString)<br />
<br />
'Create a ECDsaCng Object<br />
Dim ecdsa As ECDsaCng = New ECDsaCng(objCngKey)<br />
<br />
'Sign the string<br />
bSignature = ecdsa.SignData(data)<br />
<br />
'Convert Signature to Base64 string for better reading<br />
sSignature = Convert.ToBase64String(bSignature)<br />
<br />
'Destroy Keypair<br />
objCngKey.Delete()<br />
objCngKey.Dispose()<br />
ecdsa = Nothing<br />
<br />
'Re-Import the keys created above<br />
'Actually the code below was part of another function, to which I pass the private key which was created by the code above<br />
'The purpose of this was to sign another string with the same private key<br />
<br />
'Re-Import the previously exported public key - that works fine.<br />
objCngKey = CngKey.Import(publicKeyBytes, CngKeyBlobFormat.EccPublicBlob) 'That works fine<br />
'NOW, here's where the trouble starts:<br />
'>>>>>>>>>><br />
objCngKey = CngKey.Import(privateKeyBytes, CngKeyBlobFormat.EccPrivateBlob)<br />
<br />
'Here a cryptographic exception occurs<br />
'>>>>>>>>>><br />
'Although I am re-importing the key exactly as exported above, a cryptographic exception occurs.<br />
'What am I doing wrong? Importing the public key works fine, importing the private key fails...<br />
'I also tried to only import the private key, without importing the public key, but that does not help either ...<br />
'Is this a bug in the ECDsaCng function, or am I doing anything wrong?<br />
<br />
<br />
End Function<br />
<br />
Thanks for any help and for pointing me into the right direction.
TIA,
Steve
|
|
|
|
|
Hi,
Does anyone know if it is possible to generically add a new language to highlight, in VS 2005?
I couldn't find such option. If none like such exists, I would be happy to be referenced to an add-in that imitates that action.
Thanks
|
|
|
|
|
Take a look at the Visual Studio eXtensions (VSX) stuff - under the Visual Studio Integration Program (VSIP).
|
|
|
|
|
In 2006, I wrote a C# app (using .NET 2.0 in VS 2005 Express) which was designed to add some PHP code to several HTML files. The HTML files are encoded as ISO 8859-1.
This application worked fine until around Nov 2007 when some unknown change occurred in my Windows XP installation which resulted in hex A0 (  in html) being converted to hex EF BF BD.
I have since found info which states that an illegal character will be recoded as EF BF BD. However, A0 is a LEGAL character in ISO 8859-1 encoding.
In trying to resolve this problem I have tried all of the StreamWriter class Encoding options and have also completely uninstalled VS 2005 and all .NET SDK's and runtime and then subsequently installed .NET 3.5 SDK's (which includes the latest 2.0 SDK) and runtimes and also C# VS 2008. None of these actions resolved the problem.
Any ideas on how to prevent this conversion from occurring?
The code sequence which makes use of StreamWriter.WriteLine is as follows:
<code> private void Process_Files()
{
const bool OVERWRITE = true;
const bool APPEND = true;
ArrayList file_array = new ArrayList();
string newString;
bool found = false;
foreach (string fileName in fileList)
{
Console.WriteLine("Processing: " + fileName + ".htm");
// Add PHP authentication info to top of file
FileInfo srcFile = new FileInfo("PHP-Auth.txt");
srcFile.CopyTo(HTM_FILE_PATH + "temp.php", OVERWRITE);
StreamReader htmFile = new StreamReader(HTM_FILE_PATH + fileName + ".htm");
StreamWriter tmpFile = new StreamWriter(HTM_FILE_PATH + "temp.php", APPEND);
// Read the entire .htm file into memory.
while (!htmFile.EndOfStream)
{
file_array.Add(htmFile.ReadLine());
}
htmFile.Close();
// Append a blank line to the end of the temp.php file.
tmpFile.WriteLine();
tmpFile.WriteLine();
// Process each line of the .htm file.
foreach (string line in file_array)
{
// Compare each name in the fileList to each line of this particular
// .htm file.
foreach (string name in fileList)
{
// If this line of the file contains one of the filenames in "fileList"
// with an extension of .htm, replace it with an extension of .php, with
// the exception of a line that contains "family.htm".
if (line.Contains(name + ".htm") && !line.Contains("family.htm"))
{
found = true;
break;
}
}
if (found)
{
newString = line;
newString = newString.Replace(".htm", ".php");
tmpFile.WriteLine(newString);
found = false;
}
else
// Use the existing line.
tmpFile.WriteLine(line);
}
tmpFile.Close();
file_array.Clear();
// Rename the temp file to it's final .php name.
File.Move(HTM_FILE_PATH + "temp.php", HTM_FILE_PATH + fileName + ".php");
// Delete the old .htm filename.
File.Delete(HTM_FILE_PATH + fileName + ".htm");
}
}</code>
|
|
|
|
|
Have you tried to simply specify the encoding when you open the reader and writer?
Encoding isoWesternEuropean = Encoding.GetEncoding(28591);
StreamReader htmFile = new StreamReader(HTM_FILE_PATH + fileName + ".htm", isoWesternEuropean);
StreamWriter tmpFile = new StreamWriter(HTM_FILE_PATH + "temp.php", APPEND, isoWesternEuropean);
If that doesn't work, the file that you are reading contains a byte order mark (BOM) that overrides the encoding. You can check this by adding the .bin extension to the file and open it in Visual Studio to examine the actual binary data in the file.
If it contains a BOM, the file is broken, as it contains information about decoding it that doesn't match how it was encoded. To fix this you would either have to use/write a program that removes the BOM, or open the file as a binary stream so that you can read past the BOM before starting to read the stream with the StreamReader.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|