|
heidihund wrote: The network path was not found.
Are you sure that the machine name is correct? If it is, does the client allow remote registry access? If it's saying it can't find the network path my suspicion is the path is incorrect, or a firewall is blocking it.
|
|
|
|
|
Yes. The name is correct.
I don't think the firewall is blocking it, but the security is probably the issue, hence
I wonder if there is another way of changing the registry value remotely, where e.g. it is possible to set the username and password when accessing the registry, in order to have the security settings in order? I have gotten some hits on WMI, but I haven't found a way to do this in csharp yet.
Regards,
Heidi
heidihundala@gmail.com
|
|
|
|
|
The only way I can think of is to log on before hand because I just wrote a simple piece of code to access the registry on my Windows 2003 server which is running under the default tied down settings. It worked fine and my laptop and server on different domains but I am logged onto the server to access files and my account which I'm logged in under is a Domain Administrator group so...
|
|
|
|
|
I found a solution which is with not using OpenRemoteBaseKey(), and where you "log on" in a Connection before the change:
System.Management.ConnectionOptions oConn = new ConnectionOptions();
oConn.Username = "username";
oConn.Password = "pwd";
oConn.EnablePrivileges = true;
ManagementScope oMs = new ManagementScope(string.Format("\\\\{0}\\root\\default", MachineName), oConn);
oMs.Connect();
if (oMs.IsConnected) {
ManagementPath Path = new System.Management.ManagementPath("StdRegProv");
ManagementClass objClass = new System.Management.ManagementClass(oMs, Path, null);
ManagementBaseObject objInParams = objClass.GetMethodParameters("GetStringValue");
objInParams["hDefkey"] = LOCAL_MACHINE;
objInParams["sSubkeyName"] = KEY_NAME;
objInParams["sValueName"] = "NameOfRegKey";
ManagementBaseObject outParams = objClass.InvokeMethod("GetStringValue", objInParams, null);
objInParams = objClass.GetMethodParameters("SetStringValue");
objInParams["hDefkey"] = LOCAL_MACHINE;
objInParams["sSubkeyName"] = KEY_NAME;
objInParams["sValueName"] = "NameOfRegKey";
objInParams["sValue"] = "My value";
objClass.InvokeMethod("SetStringValue", objInParams, null);
}
Regards,
Heidi
heidihundala@gmail.com
|
|
|
|
|
Also, the code is running as the ASPNET user on the server, which doesn't have any permissions to any other machine. So, the most it's going to be able to do is look at the values under a remote HKEY_LOCAL_MACHINE hive. It won't be able to modify anything.
Unless, of course, you run the ASP.NET app on the server under a domain admin level user account, but that's a huge security risk...
|
|
|
|
|
I am developing a game the contains ball and blocks and i want the ball to break the blocks upon collision with the ball and also to award marks after every collision
The background color should fill the space of the ball
|
|
|
|
|
M'kay
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);
Morgonen är tröttmans mecka
|
|
|
|
|
Sounds like you've got the start of a design going there. Now what are you going to do?
|
|
|
|
|
Permission granted. You can proceed with coding your game.
...or was there a question buried in your post somewhere?
|
|
|
|
|
Hi,
I have a Windows Application which should send data to a Webservice.
I've added the URL of the Webservice (Add Web Reference...) to my project.
I've also added the .cs file of the Webservice in my project.
This is from the Webservice:
POST /webservices/MTomTest/Mtomdummy.asmx HTTP/1.1
Host: secret.nl
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<AddFile xmlns="http://www.secret.nl/MTOMTest/v1">
<request>
<EmailAddress>string</EmailAddress>
<Filename>string</Filename>
<FileData>base64Binary</FileData>
</request>
</AddFile>
</soap12:Body>
</soap12:Envelope>
Based on what he needs (EmailAddress, Filename, FileData) I wrote the following:
string EmailAddress;
string Filename;
string FileDataBase64Binary;
SoapBase64Binary base64Binary;
MTOMDummy AddFileService;
EmailAddress = "email@secret.nl";
Filename = "TestDeclaratie.zip";
FileDataBase64Binary = "AgMFBws=";
base64Binary = SoapBase64Binary.Parse(FileDataBase64Binary);
AddFileService = new MTOMDummy();
AddFileRequestType request = new AddFileRequestType();
The webmethod is called "AddFile" which I can call by using:
AddFileService.AddFile();
I only need to know what should give as parameters for the "AddFile" webmethod?
Any help would be greatly appriciated.
Regards,
Ronald
|
|
|
|
|
If I understtod your question correctly, you are unable to figure out the object to be passed to the AddFile() method.
You have to pass object of AddFileRequestType.
<br />
MTOMDummy AddFileService;<br />
<br />
AddFileService = new MTOMDummy();<br />
AddFileRequestType request = new AddFileRequestType();<br />
request.EmailAddress = "email@secret.nl";<br />
requestFilename = "TestDeclaratie.zip";<br />
request.FileData = <your file="" data="" in="" soapbase64binary="" format="">;<br />
AddFileService.AddFile(request);<br />
</your>
Every bit counts
|
|
|
|
|
Yes...I suppose you understand me. I did figure the following out:
string EmailAddress;
string Filename;
string FileDataBase64Binary;
SoapBase64Binary base64Binary;
MTOMDummy AddFileService;
EmailAddress = "email@secret.nl";
Filename = "declaratie1.zip";
FileDataBase64Binary = "AgMFBws=";
base64Binary = SoapBase64Binary.Parse(FileDataBase64Binary);
AddFileService = new MTOMDummy();
AddFileRequestType request = new AddFileRequestType();
request.EmailAddress = EmailAddress;
request.Filename = Filename;
request.FileData = base64Binary;
AddFileService.AddFile(request);
Now is the object "request" filled with the email address, filename but not the filedata.
The code above gives me the following error:
Cannot implicitly convert type 'System.Runtime.Remoting.Metadata.W3cXsd2001.SoapBase64Binary' to 'byte[]'
Any idea how to fill the "request.FileData" in the correct way?
|
|
|
|
|
Hello everyone,
Two questions about exceptions from ReaderWriterLock class,
1. If I use parameter -1 (no timeout value) to acquire either read or write lock, is there any possibility there will be any exceptions?
2. When we release the lock, if the current thread is the owner, is there any possibility to throw any exceptions?
thanks in advance,
George
|
|
|
|
|
ok.. so i'm adding some settings to a project and i want to modify a certain node and save it so that next time when i start the application, i have the new modified properties.
Settings set = Settings.Default;
set.SalutSetting = "New Value";
set.Save();
But the setting is restored to it's original value. What's wrong?!
I have Vista.. cand this cause any problems?
|
|
|
|
|
Is this when you're running debugging etc? You might want to call Settings.Default.Upgrade() or what ever it's called because if you've got a new version (with respect to the Version attribute of the assembly) then it won't load the old settings, you've explicitly got to call Upgrade() to copy settings from the old version to the new version.
|
|
|
|
|
I need to load/save some settings from another assembly so I changed the code to:
Configuration configManager = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
ConfigurationSectionGroup section = configManager.SectionGroups["userSettings"];
if (section != null)
{
ClientSettingsSection clientSettings = section.Sections["OutlookSync.Properties.Settings"] as ClientSettingsSection;
SettingElement element = clientSettings.Settings.Get("SalutSetting");
clientSettings.Settings.Remove(element);
element.Value.ValueXml.InnerText = "update";
clientSettings.Settings.Add(element);
configManager.Save();
}
Everything is nice and smooth when i run this code on a test project - applications are modified and next time i start the application, the updated config is taken, but when i include it in my application, the changes are not saved next time when the application starts. I searched everywhere in the application in order to find our if the configurations are override but it seems they are not. I'm complete shocked and without any ideas.
|
|
|
|
|
Sorry, I can only suggest some methods to find out some more:
Have you checked the file before and after the call to configManager.Save(); Just to see if they're being written and then overwritten. Or try making the settings file read-only and see if you get an exception when trying to save. If it does then at least you can confirm it's trying to write stuff to the file.
|
|
|
|
|
hi
I use crystall report for reporting but its too slow.How can i made it fast?
|
|
|
|
|
Hi all,
Please let me know about any class avail in .NET 2.0 to transmit single file with Credentials(username and password) on to server.
I have tried with HttpWebRequest class, but getting some problem. Do .NET have any classes to transmit file on Server.
Thanks,
Regards
Chintan
HCL Technologies...India
(Carefully) listen->(Deeply)Think->(Clearly)Understand->(Patiently) reply...
|
|
|
|
|
How about trying FtpWebRequest? Found in the System.Net namepace.
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Is it possible to control the layout of controls on a form at runtime.
Actually I have a xml file which will contain some questions & the type of answer it expects. I need to design an interface with these questions on different labels & appropriate controls for accepting the answer to these questions (it might check box, radio button or textbox...)
Thanks in Advance,
Cheers
|
|
|
|
|
jamesjk wrote: Is it possible to control the layout of controls on a form at runtime.
Yes, just write code that adjust the particular properties of the controls that you want to change. e.g. If you want to change the text of a label. just do myLabel.Text = "NewText"; If you want to add new controls, you can create them just as you would with any other object, and then you just need to add them to the forms .Controls collection.
Label myNewLabel = new Label();
myNewLabel.Text = "NewText";
this.Controls.Add(myNewLabel);
myNewLabel.Left = 50;
myNewLabel.Top = 50;
myNewLabel.Visible = true;
myNewLabel.BackColor = Color.Red;
Simon
|
|
|
|
|
Thanks Simon.
The main problem I'm facing is that the xml will be variable. I'm providing a xml editor to the user so that he can add as many questions in it.
With uncertain number of questions do you have any suggestions on how i'll be able to manage the layout ?
Thanks Again for the reply.
|
|
|
|
|
You could have 1 page per question, just do your layout for a page to fit 1 question on it, then have controls to move to the next question, which would have exactly the same layout just with the question text and answers changed. (it wouldn't actually need to be a differnt page or form or anything, just change the text on the form to match the next question)
Or, you could use something like the FlowLayoutPanel, which would allow you to add controls to it and it rearranges them to flow in order. You'd probably create one Panel per question, using a predefined layout for the panel, with question and answer buttons, then added each of the question panels to 1 main FlowLayoutPanel which would take care of ordering the question panels for you.
Simon
|
|
|
|
|
HI,
I'm working on a .Net windows application with C#. How to keep labellink control in DataGridView. One of the DataGridView's column contains the labellink controls. Please guide me. Thanks in advance.
modified on Thursday, April 17, 2008 5:55 AM
|
|
|
|