|
Hello Everybody,
i have an application which is existing on a server, i need to create a "shortcut" on a PC on the network that when clicked access that program
if someone has an idea, or a document which can help i'll be thankfull
thanks in advance
best regards
|
|
|
|
|
You need to create a shortcut, using the network path. Which bit are you stuck on ?
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
Dear christian,
to create a shortcut i have to have permission to access the server, i can't give permission to all user to access all the server, i just want them to access just the application.
is there a way to make a shortcut programatically that run this application on the server?
thank you fo your help
|
|
|
|
|
Hello!
I'm working on C# wrapper for C library. And I got two structures:
<br />
struct params<br />
{<br />
char* info;<br />
params* next;<br />
};<br />
<br />
struct device<br />
{<br />
unsigned int flags;<br />
char* name;<br />
char* description;<br />
params* p_params;<br />
device* next;<br />
};<br />
And got 2 functions I use:
<br />
int get_device_list( device* dev );<br />
void free_device_list( device* dev );<br />
So, what I do:
<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class device<br />
{<br />
[MarshalAs(UnmanagedType(UnmanagedType.U4)<br />
uint flags;<br />
<br />
[MarshalAs(UnmanagedType(UnmanagedType.LPStr)<br />
string name;<br />
<br />
[MarshalAs(UnmanagedType(UnmanagedType.LPStr)<br />
string description;<br />
<br />
IntPtr p_params;<br />
IntPtr next;<br />
<br />
public device() <br />
{<br />
name = new string( '\0', 100 );<br />
description = new string( '\0', 100 );<br />
flsgs = 0;<br />
p_params = IntPtr.Zero;<br />
next = IntPtr.Zero;<br />
}<br />
<br />
}<br />
<br />
[Dllimport("api.dll")]<br />
static extern int get_device_list( IntPtr device_ptr );<br />
<br />
[Dllimport("api.dll")]<br />
static extern int free_device_list( IntPtr device_ptr );<br />
<br />
<br />
public static void main()<br />
{<br />
device dev;<br />
IntPtr device_ptr = Marshal.AllocHGlobal( Sizeof( typeof( device ) ) );<br />
Marshal.StructureToPtr( dev, device_ptr, false ) );<br />
<br />
int result = get_device_list( device_ptr );
<br />
free_device_list( device_ptr );<br />
<br />
Marshal.FreeHGlobal( device_ptr );<br />
}<br />
<br />
Actually, I can't realize why the call of the first function is successful, and the call of second one leads to exception throwing?
Help please, thanks in advance.
|
|
|
|
|
You are using it incorrectly. If a API a freeXXX method, it normally means it will allocate the memory as well.
This means you, in this case need not allocate memory. Simply pass the pointer into the function and have it filled. Then after you have finished using it, free the memory with the freeXXX function.
You are complicating things by using a class instead of a struct. As a start, go unsafe and use a C usage example to get started.
|
|
|
|
|
Hi,
I have an application that takes data from a datagrid to an Excel spreadsheet. I would like to rename the sheets (after exporting) from the default Sheet1, Sheet2, etc to my own specified name. The code that I have below gives me an error which says that:
'Property or indexer 'Microsoft.Office.Interop.Excel.Sheets.this[object]' cannot be assigned to -- it is read only'.
Is there any other way I can do this?
//create new worksheet
Microsoft.Office.Interop.Excel._Application _appClass = new ApplicationClass();
_appClass.Visible = true;
_appClass.Caption = "Exported ECS Errors";
Microsoft.Office.Interop.Excel.Workbook wbk = _appClass.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);
wbk.Worksheets["Sheet1"] = "Mvelo";
Mvelo Walaza
Developer
Telkom SA
|
|
|
|
|
It looks like you're trying to assign a string value to the sheet object, rather than the property which contains the name. I've not done any interop in a while so I can't remember the syntax - something like:
wbk.Worksheets["Sheet1"].Name = "Mvelo";
should work about right.
HTH
Dave
It definitely isn't definatley
|
|
|
|
|
This is the error I get when I put the '.Name' code:
wbk.WorkSheets["Sheet1"].Name = "Mvelo";
'Only assignment, call, increment, decrement, and new object expressions can be used as a statement.'
Mvelo Walaza
Developer
Telkom SA
modified on Tuesday, April 22, 2008 2:15 AM
|
|
|
|
|
hi
i have to read selected items of one list box to other listbox.and the selected item should be deleted and added to other list box.its working i had done it.
but the problem is it should not hit the server while doing such process.so we have to do the coding in javascript itseems.so plz help me in this regard.pls provide me the code in javascript.
iam clear with my question?
|
|
|
|
|
Why would you ask for javascript in the C# forum ?
I suggest reading the article I link to in my sig.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
HI, i ve written an application in dotnet c#(visual studio 2005) which requires to call a function written in c(this is part of other application). So please help me on how to call this function.
|
|
|
|
|
your C function can be called as part of a dll using P/invoke. You have an app in C, not C++ ? It works the same way, anyhow, so long as it's in a dll. To call the function within a running app, you need to use WM_COPYDATA or something to set up interprocess communication.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
hi, now i ve been able to call the function from the c# application. I made the dll and in the *.def file i ve exported this particular function. Then in my c# application using [dllimport(*.dll}], i called the function and i was successful in that, Now according to the c application as soon as this function is called it populates a structure with some values and ultimately i want these values. So now after successfully calling this function how can i get the structure values????Pls help
|
|
|
|
|
hi,
by trial and error method i have added many users to the DCOM object through DCOMCNFG. I want to know while hosting the website which users would require the permissions. and also keep everything secured.
thanks,
adi_nik
|
|
|
|
|
i think you only need to add ASPNET user
|
|
|
|
|
|
Hi!
I'm developing a Winform application in C# 2.0 which access to a SQL Server Express.
Currently I'm using this connection string (app.config):
connectionString="Data Source=localhost\SQLEXPRESS;Initial Catalog=MyDB;Integrated Security=True"
As you can see, currently I'm using Windows Authentication to log on the SQL Server.
I want to add a user login form and depending on which user has logged in, I will grant or deny opening some of the forms which my application has.
How should I manage these users? I was thinking in having a table with (user,password) and encrypting the password in some way.
Is there a best practice to do this?
|
|
|
|
|
User Management can be done in two ways: using LDAP (Lightweight Directory Access Protocol), will allow only thos users to log on to the application who are a part of that windows domain. This approach might be a little cumbersome as many applications do not require such tight coupling with windows domain for allowing or denying access to users, moreover, it is certainly a tedious task to use LDAP to manage access to individual forms. The other way out, is your way, creating a table for users and storing their passwords in encrypted form, now here, I suggest to create an admin table as well that will reference to the user table on the basis of unique user id, and since you plan to grant or revoke permission on users, yourself, you can also create an admin screen in your app, wherein you can enlist all users and their information and you can grant/revoke permissions there and these details will be updated in the admin table. For the encryption part of it, u can write a simple substitution cipher program that will shift the bits to either one left or one right to give you an encrypted string, or, u can use the Encryption class of the .NET F/W, I personally prefer to write my own program for encryption, as it is great fun to experiment with n-number of ways of encrypting data. Let me know if i was able to give u some headway...
cheers
|
|
|
|
|
Ok, thanks.
I was thinking in creating two tables: (Users table and ModuleAccess table)
(User,Password)
and
(User,Module)
User is the primary key for the first table.
User+Module is the primary key for the second table.
The password column actually will save the "user+password" string encrypted. I mean, there will be a LogIn form where you must enter your user and password, after that, I will encrypt the user+password string entered in the LogIn form and compare it with the one I've saved in the table.
I will use a similiar aproach to handle the modules (forms that the user can access).
Thanks!
|
|
|
|
|
i think you should define some roles and add your users in that roles...
and on form level check which role has access to which forms
|
|
|
|
|
Hi all.
The attached code works absolutely fine. However if I want to send the "encryptedString" over a socket I receive the following exception where the send fails:
"Exception: Found a high surrogate char without a following low surrogate at index: 8. The input may not be in this encoding, or may not contain valid Unicode (UTF-16) characters.
Parameter name: chars"
However, this does work over the socket in about 1 in 10 times. I have also tried to send as bytes instead of string which solved the socket problem but corrupting the data so it couldn't be decrypted using the private key after transfer.
I am using .net 1.1
Does anyone know the solution to this problem?
Thanks, Anthony
// Represents UserA generating an rsa key pair
UnicodeEncoding byteConverter1 = new UnicodeEncoding();
RSACryptoServiceProvider rsa1 = new RSACryptoServiceProvider();
string publicKey = rsa1.ToXmlString(false);
// Represents UserB encrypting a message ("hello world") with UserA's public key
RSACryptoServiceProvider rsa2 = new RSACryptoServiceProvider();
rsa2.FromXmlString(publicKey);
UnicodeEncoding byteConverter2 = new UnicodeEncoding();
byte[] bytesToEncrypt = byteConverter2.GetBytes("hello world!");
byte[] encryptedBytes = rsa2.Encrypt(bytesToEncrypt,false);
string encryptedString = byteConverter2.GetString(encryptedBytes);
// Represents UserA decrypting the message with his private key
byte[] bytesToDecrypt = byteConverter1.GetBytes(encryptedString);
byte[] decryptedBytes = rsa1.Decrypt(bytesToDecrypt, false);
string message = byteConverter1.GetString(decryptedBytes);
string msg = message;
|
|
|
|
|
Hi People,
I have a ToolStrip with some items.
When I hit some button I load a form inside a Panel and disable some of the ToolStrip menuitems.
So far so good.
Now I want to enable those menu items when I click a button on the usercontrol that was loaded in the panel control...
How do I achieve this??
btw: Im a newbie and search google, but cannot find anything :-S
TIA,
Richard
|
|
|
|
|
There's a good article here on CP about cross form communication. Short version - you define a delegate to get a method call in one form, to call a method in another. If you google delegates, you'll find tons of examples.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
|
Thanx Cristian and cocoonwls,
I did allot of reading regarding delegates but boy o boy what a information that is
As you could probably have guessed , Im a beginner in the world of C# (If have allot of VBA experience though but this is something else)
I'll try to explain what Im trying to achieve;
I have a form (MainForm).
On MainForm there is a button that loads another form (Form2) (inside a panel, dont know if that is rellevant) and disables some menuitems using "this.relatiebeheerToolStripMenuItem.Enabled = false;"
Know.. on the Form2 I need to have a button that closes the form (Form2) and sets the menu to enabled again..
There is allot of info on delegates but I can't find anything matching my ' problem'
Please help
Richard
*edit* : I made a mistake.
Actually there is one form (MainForm) and the ' form' im loading in the panel is actually a user control.
Dont know if thats makes a difference ..
modified on Monday, April 21, 2008 6:19 AM
|
|
|
|