• 0

[c#.net]


Question

hi!

i am trying to make a dial up connection using wininet functions like internetdial() and etc.

but when i use internetdial(), dial up connection dialog box pops up which i don't want in my application.

what i want is to get all the entries of dial up connections connected to a system and then i want user to select the connection he want to connect with.

But i am not able to find any such function or some other way through which i can get all the dial up connection entries(actually just the name of all the connections).

I have searched the net but i have found nothing ..can anyone help me out in this problem.

pls provide some solution..

thanks!

Link to comment
https://www.neowin.net/forum/topic/796750-cnet/
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Under the hood, thats what I believe it is doing. When you use native APIs from managed code, you do so through Platform Invoke (http://msdn.microsoft.com/en-us/library/aa288468%28VS.71%29.aspx), or P/Invoke. Would it not be easier to use a managed wrapper then trying to build one yourself?

Link to comment
https://www.neowin.net/forum/topic/796750-cnet/#findComment-591273168
Share on other sites

  • 0

From my (very brief) look over the code, you should be able to enumerate the available entries using the RasPhoneBook type, and use the RasDialer type to perform the call:

public IEnumerable<RasEntry> GetAvailableEntries() 
{
	using (RasPhoneBook phoneBook = new RasPhoneBook()) 
	{
		phoneBook.Open();

		return phoneBook.Entries;
	}
}

You can then code a dialer that accepts one of those entries:

public class Session 
{
  #region Properties
  public RasDialer Dialer { get; set; }
  public RasEntry Entry { get; set; }
  #endregion

  #region Methods
  public void Connect()
  {
	  using (RasPhoneBook phoneBook = new RasPhoneBook())
	  {
		  phoneBook.Open();

		  Dialer.Entryname = Entry.Name;
		  Dialer.PhoneBookPath = phoneBook.Path;

		  Dialer.Dial(); // or Dialier.DialAsync();
	  }

  }
  #endregion
}

That should get you started, what I would do though, is look at the sample code DotRas is packaged with, should point you in the right direction.

Hope that helps.

Link to comment
https://www.neowin.net/forum/topic/796750-cnet/#findComment-591273310
Share on other sites

  • 0

You probably won't need it, if you are enumerating the phonebook entries (thus, the dial up connections, etc.), you should be able to bind them to a list of some sort, and then have the user select one of them, which you then pass to the dialer.

need to connect web via RAS. But any simple codes doesn't work. Can you help me please? you can download DOTRAS from http://dotras.codeplex.com/ also add reference and use it.

This codes doesn't work:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.Runtime.InteropServices;
using DotRas;

namespace RasTestsConsole1
{
    class Program
    {
        static void Main(string[] args)
        {
            using (RasDialer dialer = new RasDialer())
            {
                foreach (RasConnection connection in dialer.GetActiveConnections())
                {
                    RasIPInfo info = (RasIPInfo)connection.GetProjectionInfo(RasProjectionType.IP);
                    if (info != null)
                    {
                        Console.WriteLine("Client: {0}", info.IPAddress.ToString());
                        Console.WriteLine("Server: {0}", info.ServerIPAddress.ToString());
                    }
                    else
                    {
                        Console.Write("hata");
                    }

                    Console.ReadKey();
                }
            }
        }
    }
}

Original code source page: http://dotras.codeplex.com/wikipage?title=Getting%20Started

Link to comment
https://www.neowin.net/forum/topic/796750-cnet/#findComment-592253156
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • They couldn't have done a better job, this is beautiful!
    • Oh, of course not. The real "victims" are the people who snipe kids in the head, have killed more journalist than all the worlds wars combined, do double tap strikes on medical personnel, claim history started on October 7th, have a $700 million dollar annual Hasbara budget and pay influencers $7k a post to spout exactly this kind of propaganda. How dare you question the most moral army in the world. Victimhood belongs to these genocidal freaks alone. Anyone who denies that is literally Hitler. If you're going to support a terrorist state, the least you could do is come up with better talking points.
    • Gears of War: E-Day brings 12-player co-op, smoother traversal mechanics, and more by Pulasthi Ariyasinghe Right as the Xbox Games Showcase came to an end today, The Gears of War developer The Coalition took over to show off its next project: E-Day. This prequel project was announced back in 2024, but now we have a lot more details about its campaign, new gameplay mechanics, and even a release date. The studio says this is the first time it has managed to get the time to build the entire game in a new engine, as it had worked non-stop on new titles for years while porting classic code and assets. With Unreal Engine 5 now powering Gears of War: E-Day, The Coalition says it started completely anew, with all assets, animations, environments, and others being built from scratch. The campaign will take place across three days in the city of Kalona. The story will follow the events through the eyes of Bravo Squad. This is made up of the returning classic duo Marcus and Dom, as well as the new characters Mags Carter and Lucas Reyes. Watch the trailer below to see Marcus in action without his iconic armor and gear, just as the Locust invasion kicks off. The story will draw on classic Gears novels like Aspho Fields as well, with the studio even collaborating with author Karen Traviss. "That continuity is what makes the destruction land," says the studio. "In E-Day, you watch a living city torn apart—homes still lit, meals half-finished—while people abandon their cars and run for cover. Small details—a child’s toy, an uneaten dinner—make the loss real as everyday places collapse under the Locust assault." The movement system is getting a big overhaul here. Players will be able to slide while running, jump across gaps, climb head-height covers, and even crawl on the ground to avoid fire from enemies. As for the returning horde mode, The Coalition teased a new 12-player PvE mode. This will involve three squads of Gears going up against the incoming Locusts in larger city maps than usual. The studio says that it is going to reimagine the classic formula just as co-op games are going through a resurgence. Multiplayer was touched on today too, where Versus is coming back touting four versus four Gears PVP action set across Kalona maps. More details about multiplayer will be revealed later. Open beta weekends are kicking off this August for fans wanting to jump in early too. Gears of War: E-Day is releasing on Xbox Series X|S and PC on October 6 with pre-orders available now. It will also be a part of Xbox Game Pass on day one. Microsoft has confirmed this as an Xbox platform exclusive, as there are no plans to bring it to PlayStation or Switch.
    • Microsoft announces the return of Xbox exclusives with Gears of War and Clockwork Revolution by Pulasthi Ariyasinghe Microsoft had plenty of announcements to make today at the Xbox Games Showcase celebrating 25 years of the gaming brand. Now, under the leadership of the new Xbox CEO Asha Sharma, Xbox games are going back to their original release methods. She appeared in the livestream itself to announce the return of Xbox console exclusives. This means two major upcoming games from first-party studios won't be coming to PlayStation or Nintendo consoles: Gears of War: E-Day from The Coalition and Clockwork Revolution from InExile. Both titles will only be coming out on Xbox Series X|S consoles and Windows PCs, ditching any plans they had for PlayStation. "These are not timed exclusives," confirmed Microsoft. "We’re committed to investing in and growing XBOX both on console and beyond." The company confirmed that any already announced Xbox titles for PlayStation, under previous leadership, will continue to arrive for the rival platform. This means games like the new Halo remake, Forza Horizon 6, Fable, and State of Decay 3 will still be available on PlayStation, either at launch or later. It sounds like any new projects announced by the company will avoid other consoles in the same way. Microsoft first opened the floodgates by bringing titles like Sea of Thieves, Grounded, Hi-Fi Rush, and Pentiment to PlayStation and Nintendo consoles back in 2024. Since then, almost every new game release from Xbox Game Studios has arrived for rival consoles alongside Xbox and PC. This decision follows Sony's plans to ditch its own multiplatform releases too. Outside of multiplatform live service titles, the PlayStation maker is even abandoning its PC porting endeavors that started years ago.
  • Recent Achievements

    • Proficient
      Eric Biran went up a rank
      Proficient
    • Dedicated
      Conjor earned a badge
      Dedicated
    • Week One Done
      Windows Guy earned a badge
      Week One Done
    • Dedicated
      Mark Spruce earned a badge
      Dedicated
    • Collaborator
      conkir earned a badge
      Collaborator
  • Popular Contributors

    1. 1
      +primortal
      479
    2. 2
      PsYcHoKiLLa
      243
    3. 3
      Steven P.
      72
    4. 4
      +Edouard
      66
    5. 5
      FloatingFatMan
      65
  • Tell a friend

    Love Neowin? Tell a friend!