Skip to content

Commit

Permalink
INIT
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinlor committed Dec 12, 2017
1 parent 2464f1f commit 21b2b66
Show file tree
Hide file tree
Showing 26 changed files with 1,977 additions and 32 deletions.
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
37 changes: 5 additions & 32 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# User-specific files
*.suo
Expand Down Expand Up @@ -42,11 +40,10 @@ TestResult.xml
[Rr]eleasePS/
dlldata.c

# .NET Core
# DNX
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json

*_i.c
*_p.c
Expand Down Expand Up @@ -113,10 +110,6 @@ _TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover

# Visual Studio code coverage results
*.coverage
*.coveragexml

# NCrunch
_NCrunch_*
.*crunch*.local.xml
Expand Down Expand Up @@ -150,7 +143,7 @@ publish/
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
#*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
Expand All @@ -166,7 +159,7 @@ PublishScripts/
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

Expand Down Expand Up @@ -199,6 +192,7 @@ ClientBin/
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# Since there are multiple workflows, uncomment next line to ignore bower_components
Expand All @@ -219,7 +213,6 @@ UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
*.ndf

# Business Intelligence projects
*.rdl.data
Expand All @@ -234,20 +227,13 @@ FakesAssemblies/

# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/

# Typescript v1 declaration files
typings/

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
Expand All @@ -272,17 +258,4 @@ paket-files/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc

# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config

# Telerik's JustMock configuration file
*.jmconfig

# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
*.pyc
25 changes: 25 additions & 0 deletions V2RayS.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2006
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "V2RayS", "V2RayS\V2RayS.csproj", "{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DC6DF114-0E31-42A9-9457-318AF8B9759D}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions V2RayS/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup>
</configuration>
9 changes: 9 additions & 0 deletions V2RayS/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="V2RayS.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:V2RayS"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions V2RayS/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace V2RayS
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
}
}
42 changes: 42 additions & 0 deletions V2RayS/AutoStart.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace V2RayS
{
class AutoStart
{
public void SetStart(bool Started, string name, string path)
{
RegistryKey AutoStart = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true);
if (Started == true)
{
try
{
AutoStart.SetValue(name, path);
AutoStart.Close();
}
catch
{
MessageBox.Show("增加启动项,修改注册表出现异常!");
}
}
else
{
try
{
AutoStart.DeleteValue(name);
AutoStart.Close();
}
catch
{
MessageBox.Show("删除启动项,注册表出现异常!");
}
}
}
}
}
100 changes: 100 additions & 0 deletions V2RayS/ConfigV2RayJson.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace V2RayS
{
class ConfigV2RayJson
{
string FILE_PATH;
string Josn;
dynamic Config;
public void ReadFile(string FilePath)
{
FILE_PATH = FilePath;
Josn = System.IO.File.ReadAllText(FILE_PATH);
Config = Newtonsoft.Json.Linq.JObject.Parse(Josn);
return;
}
public void SaveFile()
{
string js = Config.ToString();
System.IO.File.WriteAllText(FILE_PATH, js);
return;
}
public string Readloglevel()
{
return Config.log.loglevel;
}
public string ReadPort()
{
return Config.inbound.port;
}
public string Readprotocol()
{
return Config.inbound.protocol;
}
public string ReadServerAddress()
{
return Config.outbound.settings.vnext[0].address;
}
public string ReadServerPort()
{
return Config.outbound.settings.vnext[0].port;
}
public string ReadServerUserID()
{
return Config.outbound.settings.vnext[0].users[0].id;
}
public string ReadServerAlterID()
{
return Config.outbound.settings.vnext[0].users[0].alterId;
}
public string ReadServerSecurity()
{
return Config.outbound.settings.vnext[0].users[0].security;
}
public void Setloglevel(string loglevel)
{
Config.log.loglevel = loglevel;
SaveFile();
}
public void SetPort(int port)
{
Config.inbound.port = port;
SaveFile();
}
public void Setprotocol(string protocol)
{
Config.inbound.protocol = protocol;
SaveFile();
}
public void SetServerAddress(string address)
{
Config.outbound.settings.vnext[0].address = address;
SaveFile();
}
public void SetServerPort(int port)
{
Config.outbound.settings.vnext[0].port = port;
SaveFile();
}
public void SetServerUserID(string serverid)
{
Config.outbound.settings.vnext[0].users[0].id = serverid;
SaveFile();
}
public void SetServeralterId(int alterId)
{
Config.outbound.settings.vnext[0].users[0].alterId = alterId;
SaveFile();
}
public void SetServersecurity(string security)
{
Config.outbound.settings.vnext[0].users[0].security = security;
SaveFile();
}
}
}
13 changes: 13 additions & 0 deletions V2RayS/Logging.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Window x:Name="Logging" x:Class="V2RayS.WindowLogging"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:V2RayS"
mc:Ignorable="d"
Title="Logging" Height="300" Width="300" Activated="Logging_Activated" AutomationProperties.Name="Logging" MinWidth="800" MinHeight="499">
<Grid>
<TextBox x:Name="V2RayLog" TextWrapping="Wrap" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Background="Black" Foreground="White" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" MaxLines="499" FontSize="14"/>

</Grid>
</Window>
Loading

0 comments on commit 21b2b66

Please sign in to comment.