|
you can use a web browser control
|
|
|
|
|
ok thank you. Im gonna ask you another stupid question but worth a try.
For example I view some portion of the map and then the internet cuts, is it possabile to cache the view part of the map so that it can be viewable withour internet connection. Because in my project the application's scenario is based on a thrid world country.
|
|
|
|
|
Hello!
I have some code that add's users to my local administrator group.
But what i would like to accoplish is to add a user from an active directory to my localmachine admin group.
My code can add a local user to the local admin group.
I tried to alter the LDAP string for the ActiveDirectory connection but now it fails to add the domain user to the localmachine admin group.
The AD LDAP String: ldap://SERVERNAME01:389/CN=TESTUSER01,CN=Users,DC=DOMAIN01,DC=local
The Test String: WinNT://WORKGROUP/STEPHAN-F894E19/TestUser1
The Test String works the AD LDAP String doesn't work.
Can anyone help me with this?
Thanks!
the Code:
private void AddUserToGroup()
{
try
{
DirectoryEntry AD = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer");
DirectoryEntry grp;
grp = AD.Children.Find("Administrators", "group");
if (grp != null) { grp.Invoke("Add", new object[] { "WinNT://WORKGROUP/STEPHAN-F894E19/TestUser1" }); }
MessageBox.Show("Account Created Successfully");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
|
|
|
|
|
i Found this code on CodeProject:
public void AddToGroup(string userDn, string groupDn)
{
try
{
DirectoryEntry dirEntry = new DirectoryEntry("LDAP://" + groupDn);
dirEntry.Properties["member"].Add(userDn);
dirEntry.CommitChanges();
dirEntry.Close();
}
catch (System.DirectoryServices.DirectoryServicesCOMException E)
{
}
}
But can anyone show me a sample LDAP String , UserDn String and a GroupDn String?
Thanks!
|
|
|
|
|
LDAP string - LDAP://CN=Administrator,CN=Users,DC=aDomain,DC=com
userDN - CN=aUser,CN=Users,DC=aDomain,DC=com
DN means distinguishedName
cool?
|
|
|
|
|
Hi,
im trying to convert the octet string (msExchSmtpRelayIpList) and convert into a list of IP addresses.
i have tried various things but just get random numbers that don't relate to IP addresses!!
can anyone help me?
Many Thanks,
Phil
|
|
|
|
|
|
Hi Curtis,
this is just what i'm looking for. although the VB script calls the dll. do you know how i could use DLLImport to make calls this this dll?
sorry for the questions, i'm a newbie at this!!
thanks is advance!
Phil
|
|
|
|
|
I haven't actually downloaded the software, just know of its abilities.
Microsoft has a tutorial on Platform Invoke at Platform Invoke Tutorial (C#)[^]
If you think that the official Microsoft tutorials don't tutor well (and I'd mostly agree with you), then Jason Clark wrote a pretty good piece for MSDN called Calling Win32 DLLs in C# with P/Invoke[^].
Either way that you learn, you'll need the signature of the method; you can get that from the VB script file.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi Curtis,
this has been a great help, and even though i understand it all much better. i still can't find the Entrypoints for the Dll. i have tried using Link /dump /exports dllname.dll and this doesn't return anything that is used in the VB script.
i have used COM browser and this shows more details, but when i use these details in the C# code it return a unable to find an entry point exception.
sorry to be a pain, could you help further?
Many Thanks,
Phil
|
|
|
|
|
Hi,
wouldn't IPAddress.Parse() take care of it?
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
|
Straight from msn:
NTSTATUS status;
status = WdfUsbTargetDeviceResetPortSynchronously(UsbDevice);
And please don't use the 'urgent!!' word inside the title, read the rules ...
|
|
|
|
|
sry about the urgent thing
anyway what is NTSTATUS ? is it a class or something ? ( i never used com and win32 stuff)
thx a lot for your time
|
|
|
|
|
Why do you ask these kind of questions to us?
The internet is like a very big book. To find some stuff in the book you can either ask people who have read it or you scan the text. For the big book called 'the internet' there are many full automatic scanners available (google.com for instance). If you have found a piece of usefull information, you should read the piece... if you'd done that, you wouldn't be asking questions.
http://msdn.microsoft.com/en-us/library/aa489609.aspx[^]
|
|
|
|
|
well i did lot of searches but no results :s
|
|
|
|
|
C# doesn't have functions.
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: C# doesn't have functions
yh i know plz read the question before you answer
|
|
|
|
|
Hello,
Can you reduce the resolution of a PDF, for example I have a pdf with a size greater than A4 is I ve go to the A4, is that possible?
Thank you very much.
|
|
|
|
|
You posted this question in much more detail four posts down and two hours ago. We do not consider it polite to repost questions.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
i have a code below, it can run but didn't work actually. can you help me?
here is my process:
Start Recording-> Stop Recording-> Play sound: nothing happened -> Play Sound (second): error at line
'this.captureBuffer.Read(0, this.stream, 100000, LockFlag.None);'
(Memory stream is not expandable.)
code:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using Microsoft.Win32;
using System.IO;
using Microsoft.DirectX.DirectSound;
using Buffer = Microsoft.DirectX.DirectSound.Buffer;
namespace Sound
{
public class Sound : System.Windows.Forms.Form
{
// private fields
private Device device;
private Capture capture;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private Buffer buffer;
private BufferDescription bufferDesc;
private CaptureBuffer captureBuffer;
private WaveFormat waveFormat;
private CaptureBufferDescription captureBuffDesc;
private MemoryStream stream;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private byte[] streamBuffer;
public Sound()
{
InitializeComponent();
// Set up DirectSound
CreateDevice();
// Load the sound
CreateWaveFormat();
CreateBufferDescription();
CreateBuffer();
// Set the cooperative level
SetCooperativeLevel();
CreateCapture();
CreateCapureDescription();
CreateCaptureBuffer();
CreateStreamBuffer();
CreateStream();
}
private void CreateDevice()
{
device = new Device();
}
private void CreateBuffer()
{
buffer = new Buffer(bufferDesc, this.device);
}
private void CreateBufferDescription()
{
bufferDesc = new BufferDescription();
bufferDesc.Format = waveFormat;
bufferDesc.BufferBytes = 100000;
bufferDesc.ControlPositionNotify = true;
bufferDesc.ControlFrequency = true;
bufferDesc.ControlPan = true;
bufferDesc.ControlVolume = true;
}
private void SetCooperativeLevel()
{
device.SetCooperativeLevel(
this, // The window for the application
CooperativeLevel.Priority // The cooperative level
);
}
private void CreateWaveFormat()
{
waveFormat = new WaveFormat();
waveFormat.BitsPerSample = 8;
waveFormat.BlockAlign = 1;
waveFormat.Channels = 1;
waveFormat.AverageBytesPerSecond = 20500;
waveFormat.SamplesPerSecond = 20500;
waveFormat.FormatTag = WaveFormatTag.Pcm;
}
private void CreateCapture()
{
capture = new Capture();
}
private void CreateCapureDescription()
{
captureBuffDesc = new CaptureBufferDescription();
captureBuffDesc.BufferBytes = 100000;
captureBuffDesc.Format = this.waveFormat;
}
private void CreateCaptureBuffer()
{
captureBuffer = new CaptureBuffer(captureBuffDesc, capture);
}
private void CreateStream()
{
stream = new MemoryStream(streamBuffer);
}
private void CreateStreamBuffer()
{
streamBuffer = new byte[100000];
for (int i = 0; i < 100000; i++)
streamBuffer[i] = 0;
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(48, 32);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(208, 23);
this.button1.TabIndex = 0;
this.button1.Text = "Play Sound";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(48, 72);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(208, 23);
this.button2.TabIndex = 1;
this.button2.Text = "Stop Sound";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(48, 136);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(208, 23);
this.button3.TabIndex = 2;
this.button3.Text = "Start Recording";
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button4
//
this.button4.Location = new System.Drawing.Point(48, 176);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(208, 23);
this.button4.TabIndex = 3;
this.button4.Text = "Stop Recording";
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// Game
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Name = "Sound";
this.Text = "Sound";
this.ResumeLayout(false);
}
#endregion
public static void AS()
{
Sound s = new Sound();
s.Show();
Application.Run(s);
}
private void button1_Click(object sender, System.EventArgs e)
{
this.captureBuffer.Read(0, this.stream, 100000, LockFlag.None);
buffer.Write(0, this.stream, (int)this.stream.Length, LockFlag.EntireBuffer);
buffer.Play(0, BufferPlayFlags.Looping);
}
private void button2_Click(object sender, System.EventArgs e)
{
buffer.Stop();
}
private void button3_Click(object sender, System.EventArgs e)
{
this.captureBuffer.Start(true);
}
private void button4_Click(object sender, System.EventArgs e)
{
this.captureBuffer.Stop();
}
}
}
modified on Friday, February 27, 2009 10:00 AM
|
|
|
|
|
No...
1. post code in the pre tags
2. post a question we can and WOULD LIKE to anwser
3. be more specific (maybe show the error?)
|
|
|
|
|
Do people expect 300+ lines of code to be debugged for free just because they posted it..?
|
|
|
|
|
How else do you think they can offer $15/hour "consulting" fees on places like RentACoder?
|
|
|
|
|
Hello everyone,
If the app.config format is wrong, for example, not a correct format XML file, application will fail from loading. Are there any ways to let me know such issue -- for example, receiving some events (so that I could write file log and event log to record this issue) if app.config loads error because of a mal-formatted XML file?
thanks in advance,
George
|
|
|
|